stop marquee on mouseover and play on mouseout
I am using the conventional marquee html tag in my site:
<marquee direction="left"><div id="logo-scroll">
<ul id="clients-logos">
<li><a href="#"><img src="images/logos/alcatel.jpg" alt="Alcatel" /></开发者_如何学编程a></li>
<li><a href="#">abs</a></li>
</ul>
</div></marquee>
how can i pause marquee through jquery on mouseover and mouseout events keeping in mind that i want to work with marquee tag not jquery script.
Thanks
Use the start
and stop
methods:
$("marquee").hover(function () {
this.stop();
}, function () {
this.start();
});
Working demo: http://jsfiddle.net/ZWQqc/
Just noticed your last line — jQuery provides the mouseenter
event to non-IE browsers here, making life much easier. You should keep your JavaScript separate from your HTML because it's much easier to maintain.
精彩评论