用户悬停图像时如何在花式框中暂停自动播放? [英] How to pause autoplay in a fancybox when user hovers the image?

查看:80
本文介绍了用户悬停图像时如何在花式框中暂停自动播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iframe中有几张图片,这些图片都在父窗口中打开了一个花式框. fancybox.js设置为autoplay:true,但是当用户将图像悬停在fancybox内时,我希望此图像画廊暂停自动播放.一旦用户徘徊,自动播放应恢复.

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.

推荐答案

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

这篇关于用户悬停图像时如何在花式框中暂停自动播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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