behavior property (marquee)
Sets or retrieves the movement of text across the marquee element.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: behavior |
Possible values:
String that sets or retrieves the type of the scrolling.
One of the following values:
The text scrolls to the end and then in the opposite direction. | |||||||
Default. The text scrolls to the end and starts over. | |||||||
The text scrolls to the end and stops. |
Default: scroll.
Example HTML code 1:
This example illustrates the use of the behavior attribute:
|
||||
<marquee style="width:200px;" behavior="alternate">alternate</marquee> <br /> <marquee style="width:200px;" behavior="scroll">scroll</marquee> <br /> <marquee style="width:200px;" behavior="slide">slide</marquee> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example shows how to change the value of the behavior property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeBehavior (elem) { var marquee = document.getElementById ("myMarquee"); // Returns the index of the selected option var whichSelected = elem.selectedIndex; // Returns the text of the selected option var scrollType = elem.options[whichSelected].text; marquee.behavior = scrollType; } </script> </head> <body> <marquee id="myMarquee" style="width:100px;" behavior="alternate">Hi There!</marquee> <select onchange="ChangeBehavior (this);" size="3"> <option selected="selected" />alternate <option />scroll <option />slide </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
Related pages:
External links:
User Contributed Comments