在mouseover上停止选取框并在mouseout上播放 [英] stop marquee on mouseover and play on mouseout

查看:107
本文介绍了在mouseover上停止选取框并在mouseout上播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用传统的滚动字幕html标签:

 < marquee direction =left><<<<<< ; div id =logo-scroll> 
< ul id =clients-logos>
< li>< a href =#>< img src =images / logos / alcatel.jpgalt =Alcatel/>< / a>< / li>
< li>< a href =#> abs< / a>< / li>
< / ul>
< / div>< / marquee>

如何通过jquery在鼠标悬停和鼠标悬停事件中暂停字幕?

感谢

解决方案

使用 start stop 方法:

 <$ (){
this.stop();
},function(){
this.start();
});




工作演示:http://jsfiddle.net/ZWQqc/


刚刚注意到你的最后一行 - — jQuery在这里为非IE浏览器提供了 mouseenter 事件,让生活变得更轻松。您应该将您的JavaScript与HTML分开,因为它更易于维护。


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.

这篇关于在mouseover上停止选取框并在mouseout上播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆