28 out of 38 rated this helpful - Rate this topic

marquee element | marquee object

[This documentation is preliminary and is subject to change.]

Creates a scrolling text marquee.

Standards information

There are no standards that apply here.

HTML information

Closing Tagrequired
CSS Displayblock

DOM Information

Inheritance Hierarchy

 Node
  Element
   HTMLElement
     marquee

Remarks

The default width of the MARQUEE element is equal to the width of its parent element. When a MARQUEE is in a TD that does not specify a width, you should explicitly set the width of MARQUEE. If neither the MARQUEE nor the TD has a width specified, the marquee is collapsed to a 1-pixel width.

To create a vertically scrolling marquee, set its scrollLeft property to 0. To create a horizontally scrolling marquee, set its scrollTop property to 0, overriding any script setting.

The scrollLeft and scrollTop properties are read-only while the marquee is scrolling. When not scrolling, scrollLeft is read/write for a marquee set to scroll horizontally and scrollTop is read/write for a marquee set to scroll vertically.

Examples

The following example uses the MARQUEE element to scroll the marquee from left to right across the screen, moving it 10 pixels every 200 milliseconds.


<MARQUEE DIRECTION=RIGHT BEHAVIOR=SCROLL SCROLLAMOUNT=10 SCROLLDELAY=200>
This is a scrolling marquee.
</MARQUEE>

The following example shows some uses of the scrollLeft and scrollTop properties with the marquee element.



<MARQUEE id=m1 direction=right style="border-width:2px;border-style:solid;" 
width=200 height=200>right</MARQUEE><BR>
<!-- Push this button to read the scrollLeft and scrollTop property values 
as the marquee scrolls. -->
<BUTTON onclick="alert('scrollLeft: ' + m1.scrollLeft + ' scrollRight: ' + m1.scrollTop)">
Read</BUTTON>
<!--When the marquee is stopped, you can set scrollLeft in a horizontal marquee, 
or set scrollTop in a vertical marquee.   -->
<BUTTON onclick="m1.stop();m1.scrollLeft = 190;">Stop & Set scrollLeft=190
</BUTTON>
<BUTTON onclick="m1.start();">Start</BUTTON>


 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ