Starting and stopping of scrolling by mouse over and mouse out
Since Marquee HTML tag gives us scrolling text in web pages we can use them for various purposes in our page design. One of the common use is scrolling news items in the web page which continuously display scrolling messages. We will learn how to stop this scrolling by placing Mouse pointer over this and again starts scrolling once the mouse is taken out of the scrolling area. WE will be using OnMouseover and OnMouseout event triggers. To indentify the message div area we will assign one id value to it through getElementById. Here is the code to do this.
<marquee id='scroll_news' style="font-family:Book Antiqua; color: #FFFFFF" bgcolor="#000080" ><div onMouseOver="document.getElementById('scroll_news').stop();" onMouseOut="document.getElementById('scroll_news').start();">News 1 News 2 News 3 News 4 ....... More news here </div></marquee>
As you have seen the scrolling news stops when mouse pointer is kept over them and starts scrolling again when mouse is removed. Note that each item can be a different link to different pages or news links so let us try displaying each news item with hyper links to different pages. WE have kept links to different sections of the plus2net here.