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();">www.hemant9807.blogspot.in ----- hemant vishwakarma www.hemant9807.blogspot.in ----- hemant vishwakarma www.hemant9807.blogspot.in ----- hemant vishwakarma www.hemant9807.blogspot.in ----- hemant vishwakarma</div></marquee>
Starting and stopping of scrolling by mouse over and mouse out in marquee
No comments:
Post a Comment