How to create a marquee

Below is the code for the marquee above

<marquee behavior=alternate width=400 height=20> How to create a marquee </marquee>

You can now use HTML tags within the marquee tag.

You can use standard HTML tags within the marquee tags to further enhance the effect

<marquee align=center behavior=scroll width=100% height=20><font size=5 color="#FFFFFF">You can use standard HTML tags within the marquee tags to further enhance the effect</font></marquee>


Attributes Description
behavior scroll, alternate, slide.
The default value is scroll.
direction left, right, up, down.
The default value is right.
width Specifies the width of the marquee, in px or % units.
height Specifies the height of the marquee, in px or % units.
scrollAmount Specifies the amount in pixels the marquee should scroll each time it's redrawn (see scrollDelay).
The default value is "6".
scrollDelay Specifies the amount in milliseconds between times the marquee is redrawn.
Default value is "85".
trueSpeed Specifies whether the marquee should catch up with any skipped cycles.
The default value is "false."
loop Specifies the number of times the marquee should repeat itself when it reaches the end of the message.
The default value is "infinite".
Vspace=n
Hspace=n
Bgcolor=colour
 
events Description
onStart Fires just when the marquee is about to scroll.
onFinish Fires as soon as the marquee has completed scrolling.
onbounce Fires when the marquee has reached it's end and begins to reverse directions. Applicable only if behavior attribute is set to alternate.
onMouseover Fires when the mouse moves over the marquee.
onMouseout Fires when the mouse moves out.
onClick Fires when a click is detected on the marquee.
 
Methods Description
start() Starts the scrolling of the marquee
stop() Stops the marquee.

This effect uses the "Onbounce" event
to fire a Javascript function.

This first box uses only the scrollAmount attribute

The second box includes onmouseover and onmouseout events

The the third box incorporates the Start and Stop methods

This second example includes onmouseover and onmouseout" events

This example uses the Start and Stop methods

Start | Stop


Delay the start of marquee

<script type="text/javascript">
<!--
function move(){
javascript:scroller1.scrollAmount=5

scroller2.style.visibility="visible"
javascript:scroller2.scrollAmount=5
}
setTimeout("move()",2000)
//-->
</script>

<marquee id="scroller1" behavior=alternate onstart="this.scrollAmount=0">A Marquee Message</marquee>

<marquee id="scroller2" behavior=alternate onstart="this.scrollAmount=0" style="visibility:hidden">A Marquee Message</marquee>


Hi