Friday, July 3, 2015

Mousewheel event not working in safari within iframe


So a new strange issue that went live, while implementing a iframe window with a mousewheel handler stopped working in safari (mac).
And it was very strange because it was working on webkit browsers (like chrome) and other browsers perfectly fine.

And to be precise, was using it says

"A jQuery plugin that adds cross-browser mouse wheel support with delta normalization."

then why it is not working in safari for me.

Then collected my thoughts and found that it is working as such in safari but completely switching off when served inside an iframe in safari, so googled a bit and found which is kind of an open debate/bug whether it should work or not but in a nutshell the things that made it work was


yes as such this piece of code does nothing significant but somehow it passes scroll event from main window to pertaining iframe (in safari) and it make is work :)

there is one more solution and that is to

Open the Safari dev tools and run the following code:
  var f = function() {};
  document.addEventListener("mousewheel", f);
  document.removeEventListener("mousewheel", f);

But haven't given that a try

1 comment:

  1. Thank you!! this really saved me today!


The baffling IQ test

Getting 100 per cent means you “have a passion for perfection and you like to challenge yourself. You excel in finding problems and solutio...