How to capture click event with jQuery for iframe?

前端 未结 4 837
攒了一身酷
攒了一身酷 2020-12-10 18:28

I\'m trying to pause the slider on the homepage when a video is played so it doesn\'t keep sliding. Check it out here.

I\'ve tried adding a div on top o

4条回答
  •  一个人的身影
    2020-12-10 18:44

    It doesn't seem possible to capture the click event of an iFrame when the content is from another domain. One solution that might be good enough is to pause the animation whenever the user moves the mouse over the iframe and then play it again when the mouse leaves. This seems to work fine even if the user chooses to go fullscreen in the Vimeo player.

    Here's my little test http://jsfiddle.net/r8guJ/

提交回复
热议问题