HTML/JavaScript:如何停止marquee onload,并开始鼠标悬停?

Joh*_*ith 4 html javascript scroll marquee mouseover

我正在使用以下HTML代码来水平滚动文本:

<marquee behavior="scroll" direction="left" onmouseover="this.start();" onmouseout="this.stop();">Go on... hover over me!</marquee>
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是,一旦您访问该页面,marquee开始自动滚动.我想要做的是冻结marquee直到你鼠标悬停.

Jon*_*n P 10

我在这里听起来居高临下......

2013年.大帐篷标签已经死了.它是浏览器特定的.这是完全错误的,开始时是一个错误.

在语义html的现代时代,应该使用html来定义内容.视觉样式应该应用CSS和视觉效果与CSS补充javascript(如果需要).

有关现代方法的biref概述,请参阅此文章.

有纯CSS3方法:http://www.hongkiat.com/blog/css3-animation-advanced-marquee/

并且可能最适合你:javascript(和jQuery)解决方案:http://remysharp.com/2008/09/10/the-silky-smooth-marquee/.注意:链接解决方案中的示例使用marquee标记,但您不限于使用marquee标记.您可以使用任何有效的jquery选择器.