How to pause autoplay in a fancybox when user hovers the image?

会有一股神秘感。 提交于 2019-12-12 04:30:26

问题


I have several images in iframes that all open a fancybox in the parent window. The fancybox.js is set to autoplay:true, but I would like this image-gallery to pause autoplay when a user hovers the image inside the fancybox. As soon as the users hovers away, the autoplay should resume.


回答1:


<script>
$(document).ready(function() {
$("#Your-div").fancybox({
autoPlay:true, //Sets AutoPlay to 3 seconds********************
stopOnHover : true,
});
});
    </script>


来源:https://stackoverflow.com/questions/37594765/how-to-pause-autoplay-in-a-fancybox-when-user-hovers-the-image

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