如我所愿,html如何使用javascript停止选取框元素?
让我们,
<marquee behavior="alternate" direction="right">hello</marquee>当我将鼠标放在文本hello上时,我想停止移动它。
谢谢。
发布于 2014-12-25 15:00:36
您可以简单地内联添加行为更改:
<marquee behavior="alternate" onmouseover="this.scrollAmount = 0"
onmouseout="this.scrollAmount=10" direction="right">hello</marquee>发布于 2014-12-25 15:13:55
演示- http://jsfiddle.net/h4ww3jsv/
<marquee onmouseover="this.stop();" onmouseout="this.start();" behavior="alternate" direction="right">hello</marquee>
发布于 2014-12-25 15:08:06
下面的代码不能在Mozilla v27上运行
<marquee behavior="alternate" onmouseover="this.scrollAmount = 0"
onmouseout="this.scrollAmount=10" direction="right">hello</marquee>此问题的解决方案是使用以下代码
<marquee onMouseOver="this.setAttribute('scrollamount', 0, 0);" OnMouseOut="this.setAttribute('scrollamount', 6, 0);">Hello</marquee> 小提琴:http://jsfiddle.net/3kedfyos/3/
我还推荐阅读https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee。
https://stackoverflow.com/questions/27644919
复制相似问题