Hover Over to Pause Marquee

假装没事ソ 提交于 2019-12-01 02:55:10

I'm only anwering this out hilarity because I havent seen anyone use the marquee tag in YEARS

Had to look it up, but the marquee tag has an attribute called "scrollamount" which controls how fast it goes. So all we need to do is set the value to 0 when we hover in and set it back to 5 when we mouse out.

DEMO: http://jsfiddle.net/U9yFj/

$(function() {
    $('marquee').mouseover(function() {
        $(this).attr('scrollamount',0);
    }).mouseout(function() {
         $(this).attr('scrollamount',5);
    });
});

I hope I get mad upvotes for this

<marquee onmouseover="this.stop();" onmouseout="this.start();">
my text here
</marquee>

You're using wrong case: onMouseOver,onMouseOut

<marquee behavior="scroll" scrollamount="5" direction="left" onmouseover="this.setAttribute('scrollamount',0);" onmouseout="this.setAttribute('scrollamount',5);">
 Your name, your address, your details scrolling through line
</marquee>

Hope this code will help someone who is use MARQUEE tag.

<marquee id="mq" direction="right" loop="true" onmouseover="this.stop();" onmouseout="this.start();">
    <a href="http://google.com">Google</a>
    <input type="text" id="txt" />
    <input type="button" id="btn" value="Click here" onclick="alert(txt.value);" />
    Some other text here</marquee>

<marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();">
    Go on... hover me (and hold the mouse over)!
</marquee>
Jiwan

You can simply use the HTML marquee markup with

onmouseover="stop()"

followed by

onmouseout="start()"
RAHUL RAWAT

You have to add ; to your code after closing the () .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!