2

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.

Shifra
  • 41
  • 1
  • 10

2 Answers2

1

You can style the iframe with the following:

style="pointer-events:none;"
Marc Hägele
  • 242
  • 1
  • 12
0

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?

Bitz
  • 1,128
  • 11
  • 33