How to capture click event with jQuery for iframe?

前端 未结 4 824
攒了一身酷
攒了一身酷 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:48

    You can use this jQuery plugin : https://github.com/finalclap/iframeTracker-jquery.

    Select the vimeo player iframe with a jQuery selector and set a callback function that will turn off the slider (or do anything else) :

    jQuery(document).ready(function($){
        $('.vimeo_player iframe').iframeTracker({
            blurCallback: function(){
                // Stop your slider
            }
        });
    });
    

提交回复
热议问题