gpt4 book ai didi

jquery - Fotorama slider : How can I get the slider to pause on mouse over the resume auto play when mouse out?

转载 作者:行者123 更新时间:2023-12-01 01:24:11 27 4
gpt4 key购买 nike

Fotorama slider : slider 设置为 Autoplay="true",效果很好。如何让 slider 在鼠标悬停时暂停,然后在鼠标移开时恢复自动播放?这是我的代码:

<div class="fotorama" data-width="1170" data-ratio="1170/374" 
data-max-width="100%" data-autoplay="true" data-autoplay="3000"
data-stopautoplayontouch="false">

最佳答案

var $fotorama = $('.fotorama'),
interval = $fotorama.data('autoplay'),
fotorama = $fotorama.data('fotorama');

$fotorama.hover(
function () {
fotorama.stopAutoplay();
},
function () {
fotorama.startAutoplay(interval);
}
);

fiddle :http://jsfiddle.net/aha3xLsy/

关于jquery - Fotorama slider : How can I get the slider to pause on mouse over the resume auto play when mouse out?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19200335/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com