HTMLMarqueeElement

草案
此页面不完整。

弃用
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

HTMLMarqueeElement interface provides methods to manipulate <marquee> elements. It inherits properties and methods from the HTMLElement 接口。

特性

Inherits properties from its parent, HTMLElement .

HTMLMarqueeElement.behavior
Sets how the text is scrolled within the marquee. Possible values are scroll , slide and alternate . If no value is specified, the default value is scroll .
HTMLMarqueeElement.bgColor
Sets the background color through color name or hexadecimal value.
HTMLMarqueeElement.direction
Sets the direction of the scrolling within the marquee. Possible values are left , right , up and down . If no value is specified, the default value is left .
HTMLMarqueeElement.height
Sets the height in pixels or percentage value.
HTMLMarqueeElement.hspace
Sets the horizontal margin.
HTMLMarqueeElement.loop
Sets the number of times the marquee will scroll. If no value is specified, the default value is −1, which means the marquee will scroll continuously.
HTMLMarqueeElement.scrollAmount
Sets the amount of scrolling at each interval in pixels. The default value is 6.
HTMLMarqueeElement.scrollDelay
Sets the interval between each scroll movement in milliseconds. The default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead, unless trueSpeed is true .
HTMLMarqueeElement.trueSpeed
默认情况下, scrollDelay values lower than 60 are ignored. If trueSpeed is true , then those values are not ignored.
HTMLMarqueeElement.vspace
Sets the vertical margin.
HTMLMarqueeElement.width
Sets the width in pixels or percentage value.

事件处理程序

HTMLMarqueeElement.onbounce
Fires when the marquee has reached the end of its scroll position. It can only fire when the behavior attribute is set to alternate .
HTMLMarqueeElement.onfinish
Fires when the marquee has finished the amount of scrolling that is set by the loop attribute. It can only fire when the loop attribute is set to some number that is greater than 0.
HTMLMarqueeElement.onstart
Fires when the marquee starts scrolling.

方法

Inherits methods from its parent, HTMLElement .

HTMLMarqueeElement.start()
Starts scrolling of the marquee.
HTMLMarqueeElement.stop()
Stops scrolling of the marquee.

范例

<marquee>This text will scroll from right to left</marquee>
<marquee direction="up">This text will scroll from bottom to top</marquee>
<marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid">
  <marquee behavior="alternate">
    This text will bounce
  </marquee>
</marquee>
					

规范

规范 状态 Comment
HTML Living Standard
The definition of 'HTMLMarqueeElement' in that specification.
实时标准 Made obsolete in favor of CSS but define its expected behavior for backward compatibility.
HTML 5.2
The definition of 'HTMLMarqueeElement' in that specification.
Recommendation No changes.
HTML 5.1
The definition of 'HTMLMarqueeElement' in that specification.
Recommendation No changes.
HTML5
The definition of 'HTMLMarqueeElement' in that specification.
Recommendation Made obsolete in favor of CSS but define its expected behavior for backward compatibility.

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
HTMLMarqueeElement
弃用
Chrome 1 Edge 12 Firefox 65
65
Before Firefox 65, <marquee> implemented the HTMLDivElement 接口。
IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65
65
Before Firefox 65, <marquee> implemented the HTMLDivElement 接口。
Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
behavior
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
bgcolor
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
direction
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
height
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
hspace
弃用
Chrome Yes Edge 12 Firefox 65 IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 65 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
loop
弃用
Chrome Yes Edge 12 Firefox 65 IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 65 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
scrollamount
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
scrolldelay
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0
truespeed
弃用
Chrome Yes Edge 12 Firefox 65 IE 4 Opera Yes Safari No WebView Android Yes Chrome Android Yes Firefox Android 65 Opera Android Yes Safari iOS No Samsung Internet Android Yes
vspace
弃用
Chrome Yes Edge 12 Firefox 65 IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 65 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
width
弃用
Chrome 1 Edge 12 Firefox 65 IE 2 Opera 7.2 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 65 Opera Android 10.1 Safari iOS Yes Samsung Internet Android 1.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
弃用。不要用于新网站。
弃用。不要用于新网站。
见实现注意事项。

另请参阅

  1. HTMLMarqueeElement
  2. Related pages for HTML DOM
    1. BeforeUnloadEvent
    2. DOMStringMap
    3. ErrorEvent
    4. GlobalEventHandlers
    5. HTMLAnchorElement
    6. HTMLAreaElement
    7. HTMLAudioElement
    8. HTMLBRElement
    9. HTMLBaseElement
    10. HTMLBaseFontElement
    11. HTMLBodyElement
    12. HTMLButtonElement
    13. HTMLCanvasElement
    14. HTMLContentElement
    15. HTMLDListElement
    16. HTMLDataElement
    17. HTMLDataListElement
    18. HTMLDialogElement
    19. HTMLDivElement
    20. HTMLDocument
    21. HTMLElement
    22. HTMLEmbedElement
    23. HTMLFieldSetElement
    24. HTMLFormControlsCollection
    25. HTMLFormElement
    26. HTMLFrameSetElement
    27. HTMLHRElement
    28. HTMLHeadElement
    29. HTMLHeadingElement
    30. HTMLHtmlElement
    31. HTMLIFrameElement
    32. HTMLImageElement
    33. HTMLInputElement
    34. HTMLIsIndexElement
    35. HTMLKeygenElement
    36. HTMLLIElement
    37. HTMLLabelElement
    38. HTMLLegendElement
    39. HTMLLinkElement
    40. HTMLMapElement
    41. HTMLMediaElement
    42. HTMLMetaElement
    43. HTMLMeterElement
    44. HTMLModElement
    45. HTMLOListElement
    46. HTMLObjectElement
    47. HTMLOptGroupElement
    48. HTMLOptionElement
    49. HTMLOptionsCollection
    50. HTMLOutputElement
    51. HTMLParagraphElement
    52. HTMLParamElement
    53. HTMLPictureElement
    54. HTMLPreElement
    55. HTMLProgressElement
    56. HTMLQuoteElement
    57. HTMLScriptElement
    58. HTMLSelectElement
    59. HTMLShadowElement
    60. HTMLSourceElement
    61. HTMLSpanElement
    62. HTMLStyleElement
    63. HTMLTableCaptionElement
    64. HTMLTableCellElement
    65. HTMLTableColElement
    66. HTMLTableDataCellElement
    67. HTMLTableElement
    68. HTMLTableHeaderCellElement
    69. HTMLTableRowElement
    70. HTMLTableSectionElement
    71. HTMLTemplateElement
    72. HTMLTextAreaElement
    73. HTMLTimeElement
    74. HTMLTitleElement
    75. HTMLTrackElement
    76. HTMLUListElement
    77. HTMLUnknownElement
    78. HTMLVideoElement
    79. HashChangeEvent
    80. History
    81. ImageData
    82. Location
    83. MessageChannel
    84. MessageEvent
    85. MessagePort
    86. Navigator
    87. NavigatorGeolocation
    88. NavigatorID
    89. NavigatorLanguage
    90. NavigatorOnLine
    91. NavigatorPlugins
    92. PageTransitionEvent
    93. Plugin
    94. PluginArray
    95. PopStateEvent
    96. PortCollection
    97. PromiseRejectionEvent
    98. RadioNodeList
    99. Transferable
    100. ValidityState
    101. Window
    102. WindowBase64
    103. WindowEventHandlers
    104. WindowTimers