How to Stop and Start HTML Marquees
Stopping and Starting HTML Marquees
How to pause scrolling text that is created with HTML <marque> tag, when the user hovers over on it, It needs to continue when mouse out of the scrolling text.
i.e,
Pausing a scrolling marquee text, ex: news article, when the user moves the mouse on it and should start scrolling again when the mouse is out of that text.
Ex:
<marquee behavior="scroll" direction="right" onmouseover="this.stop();"
onmouseout="this.start();">
<h3> Go on… hover on this text (and hold the mouse over)!</h3>
</marquee>
More on HTML Marquee tag
Marquee tag allows you to create a scrolling text on a webpage. HTML provided different.
attributes for adding additional properties to scrolling text.
Attributes
1. behavior
Indicate the behavior of how the text scrolls. It can be one of the following.
values: alternate, scroll, slide
2. direction
Direction indicates that the text scrolling direction.It can be one of the following values:
left, right, up, down. The default value is left if the direction attribute is not specified.
Methods
The <marquee> tag has the following methods:
start()
stop()
Demo.html
<!DOCTYPE html>
<html>
<head>
<title> code-zon demo</title>
<style>
marquee
{
font-family: "calibri";
color: #FFFFFF;
background-color : #000080;
}
h1{
text-align: center;
}
</style>
</head>
<body>
<h1> Stop and Start Marquee Text</h1>
<marquee direction="left" onmouseover="this.stop();" onmouseout="this.start();">
<h3> This is an example of Marquee Text</h3>
</marquee>
</body>
</html>
Output:
Comments
Post a Comment