Reputation: 41
I have an iframe with a youtube video inside an html page. When I try scrolling, I cannot scroll while my mouse is over the iframe. I found this question below but param doesn't help me as this is an object and mine is an iframe.
Avoid scroll-wheel hijack by embedded youtube / flash video
I saw the solution to put an invisible div on top, but that is a problem because the user won't be able to click to pause/play the video.
Does anyone have another solution?
Thanks.
Upvotes: 2
Views: 1907
Reputation: 342
You can style the iframe with the following:
style="pointer-events:none;"
Upvotes: 1
Reputation: 1148
You can try delegating the video play/pause functions to a button somewhere else:
var myPlayer = document.getElementById('playerid');
myPlayer.stopVideo();
Source: How can I stop a video with Javascript in Youtube?
Upvotes: 0