Tuesday, December 18, 2012

Using Marquee in HTML


Horizontal Marquee – Used for making a sliding text from left to right or right to left.

<marquee direction="left" scrollamount="2" onmouseover="this.stop();" onmouseout="this.start();" scrolldelay="0">
Hey, its great.
</marquee>

Description of attributes:
“direction” : - specifies the direction of the scroll. ‘left’, ‘right’ for Horizontal Marquee and ‘up’, ‘down’ for vertical  scrolling.
“scrollamount” : - specifies the speed of scrolling.
“scrolldelay”: - for delay between repetition.
“onmouseover” calls the inbuilt javascript function ‘this.stop()’ for stopping the scrolling when mouse is over the block.
“onmouseout” calls the inbuilt javascript function ‘this.start()’ for again starting the scrolling when mouse is moves out of the block.

Vertical Marquee – It is used for making auto-scroll of blocks (Ex. News blocks). The following script automatically scrolls the block’s content from down to up direction. It eliminates the overhead of JavaScript.

<marquee direction="up" scrollamount="2" onmouseover="this.stop();" onmouseout="this.start();" height="100px;" style=="width:100px;"   scrolldelay="0">
Line 1<br />
Line 2<br />
Line 3<br />
Line 4<br />
Line 5<br />
Line 6<br />
Line 7<br />
Line 8<br />
Line 9<br />
Line 10<br />
</marquee>

No comments:

Post a Comment