我使用了以下jquery选框,但它无法在鼠标上停止..是jquery中的任何解决方案......
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/jquery.marquee/1.3.1/jquery.marquee.min.js"></script>
<script type="text/javascript">
$('.marquee').marquee({
//speed in milliseconds of the marquee
duration: 10000,
//gap in pixels between the tickers
gap: 100,
//time in milliseconds before the marquee will start animating
delayBeforeStart: 0,
//'left' or 'right'
direction: 'left',
//true or false - should the marquee be duplicated to show an effect of continues flow
duplicated: true
});
</script>
&#13;
.marquee {
width: 300px;
overflow: hidden;
border: 1px solid #ccc;
background: #ccc;
}
&#13;
<div class="marquee">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
&#13;
答案 0 :(得分:1)
$(".marquee").on("mouseover", function(e){
$(this).marquee("toggle");
});
使用&#34;切换&#34;暂停和恢复动画的方法。
答案 1 :(得分:0)
您可以使用pauseOnHover选项。请参阅:https://github.com/aamirafridi/jQuery.Marquee/blob/master/README.md