SCROLLING MARQUEE'S

 

Scrolling marquees have been popular ever since they were created. In this tutorial i plan to go in-depth on the Scrolling Marquee and al of its features, as well as provide a complete cross-browser customizable marquee with JavaScript features (this is at the end).

The basic syntax for the marquee is:
<marquee>Text</marquee>

Any text between the two tags appears on its own line, scrolling from left to right (by default, we will learn how to change this a little bit later on) at a slow pace. When the message completely disappears on the left, it starts over on the right again, and so on. Incompatible browsers simply show the text within the tags inline with surrounding text. Now lets take a look at the attributes that are built into the <marquee> tag.

 

Now that i have bored you with all this reading, i should probably show some examples of those attributes being used. Lets start with the most simplest example, making a marquee that scrolls left:
<marquee behavior=scroll direction="left">Your message here</marquee>
This produces:
Your message here
Remember you can change LEFT to also be UP, RIGHT, DOWN.

Now how about making the marquee alternate back and forth?
<marquee behavior="alternate">your message here</marquee> Producing:
your message here

Now how about adding some nice backround color to our marquee?
<marquee bgcolor="#FF0000">your message here</marquee>
Producing:
your message here
Don't forget to replace FF0000 with any hexadecimal color code you wish.

Now how about controlling the speed of the marquee?
<marquee scrollamount="5">your message here</marquee>
This will produce:
Your message here

Now you can customize what is inside the marquee tag in any way you want. You can add images, JavaScript, PHP and everything else. Here is a customized marquee I often use:

Wednesday, August 10, 2005

Important News Heading
News Content

Important News Heading
News Content

More News Content


Now how am I achieving these effects? Well this is a simple marquee tag with some JavaScript added into it. Here is the code:
<center>
<marquee height="65" width="200" onmouseover="this.stop()" onmouseout="this.start()" direction="up" scrollamount="1" style="Filter:Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, StartY=40, FinishX=0, FinishY=0);"><font face="verdana" color="#000000">
           <center><b><script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("
<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")

</script>
<br>
           <br>
           </b>
<u>Important News Heading</u>
<br>
News Content
<br>
<br>

<u>Important News Heading</u>
<br>
News Content
<br>
<br>
More News Content
<br>
           </center>
           </font></marquee>
</center>
Hosted by www.Geocities.ws

1