user3307957
user3307957

Reputation: 11

video-js: vjs-big-play-button isn't hidden after click

I'm using a Wordpress. After a click on video vjs-big-play-button isn't hidden, it only hides after video starts to play. I tried the following jQuery:

jQuery('.video-js').click(function(){
jQuery('.vjs-big-play-button').hide();});

But I can't find the correct click event, I tried all classes I can find with code inspector in Firefox but nothing is working.

Please help!

Upvotes: 1

Views: 1386

Answers (1)

Bruno Monteiro
Bruno Monteiro

Reputation: 712

Probably because the "play" button is generated dynamically by JS, you should write your function using on().

$(".vjs-big-play-button").on("click", function(){
    $(this).fadeOut();
});

Here is a working example: http://jsfiddle.net/0ak9066o/

You can read more about on() event at jQuery official documentation: http://api.jquery.com/on/

Upvotes: 1

Related Questions