Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[tut] Make a news scroller without Javascript
#1
Today im going to show you how to make a scroller using HTML, this can be used on your website or myspace and can be customised to include all sorts of content.

Below is the basic code for the scroller:
Code:
<div id="scroller" height="300px" width="200px">
<marquee ID="scroll2" scrollamount="3" direction="up" height="350">
<!--Put the stuff that you want to scroll between here-->
Put your stuff here and here
<!--and here-->
</marquee>
</div>
Simply put the html you want to scroll in the space specified in the code.

What to put there?
If you wish to put one line after another there to form for example a list simply type the item followed by:

<p />

So for example your final code would be:

Code:
<div id="scroller" height="300px" width="200px">
<marquee ID="scroll2" scrollamount="3" direction="up" height="350">
<!--Put the stuff that you want to scroll between here-->
Item 1
<p />
Item 2
<p />
Item 3
<p />
<!--and here-->
</marquee>
</div>
You can also use html to format your text so for example put <b> </b> around your text to make it bold.

You can also customise your scroller a bit.
To change the size substitute 300px for the height of your choice and 200px for the width of your choice.
To change the speed simply change the scrollamount="3" value.
Finally to change the direction change direction="up" to direction="down"

Enjoy!

Note: Absolutely no reproduction is permitted without my express authorization.

Edit: The Javascript to start and stop this scroller on mouse over is available below (or click here)
MyBB Support team member.
[Image: smallsig.png]
Reply
#2
Simple but clever Tongue
Reply
#3
Thanks, I will probably post the Javascript extension to this code so it will pause and things soon (just got to find the code in all my files....)
MyBB Support team member.
[Image: smallsig.png]
Reply
#4
Nice, but you're not showing anything big, just a simple use of the marquee tag.
The js code would be nice to see, until then this is just simple html!
Reply
#5
Exactly, it is basic but it's also really easy to implement, you only have to copy one section of code and I had the written tutorial lying around not being used.
MyBB Support team member.
[Image: smallsig.png]
Reply
#6
Actually pretty cool nice tut.
[Image: signature.php?uid=1]
Reply
#7
Ok, here is the javascript that will make it stop and go on mouse over, it's super simple, just put this in your HTML head:
Code:
<script type="text/javascript">
function scrollover(){
document.getElementById('scroll2').scrollAmount = 0;
return false;
}
function scrollout(){
document.getElementById('scroll2').scrollAmount = 3;
return false;
}
</script>

And add this to the scroller div:
Code:
onMouseOver="scrollover()" onMouseOut="scrollout()"

So the complete code to put where you want the scroller would be:
Code:
<div id="scroller" height="300px" width="200px" onMouseOver="scrollover()" onMouseOut="scrollout()">
<marquee ID="scroll2" scrollamount="3" direction="up" height="350">
<!--Put the stuff that you want to scroll between here-->
Item 1
<p />
Item 2
<p />
Item 3
<p />
<!--and here-->
</marquee>
</div>
MyBB Support team member.
[Image: smallsig.png]
Reply
#8
Even better Smile I wish I could use this.
[Image: signature.php?uid=1]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [tut] I Want to Make a Website, but, I don't know What to Do Grizzly 2 1,491 04-16-2014, 08:51 AM
Last Post: cracker007
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,095 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,630 01-26-2012, 03:13 PM
Last Post: iRun
  Close Tab With Javascript. Qua 3 1,224 07-02-2011, 07:25 AM
Last Post: djakariuz
  [TUT]Learn to edit and make pics in HTML. SVG coding language. Easy to learn! [TUT] Qua 2 1,222 06-24-2011, 09:42 PM
Last Post: Qua

Forum Jump:


Users browsing this thread: 1 Guest(s)