jquery.nicescroll icon indicating copy to clipboard operation
jquery.nicescroll copied to clipboard

iframe inside with content fixed height not getting scrolled using mouse wheel

Open andrewjoypappu opened this issue 8 years ago • 8 comments

referring to:

This is a weird bug but all custom scroll plugins like nicescroll , perfectscrollbar , or even jScrollPane have the same issue , whenever an iframe is embedded with the container to be scrolled , the iframe never listens to mouse wheel event neither touch swipe events ( to scroll on mobile devices ) , searched everywhere to find a solution seems that people have submitted issues on plugins pages , but no one realised that it is a universal bug not a bug from the plugin itself. http://stackoverflow.com/questions/27912728/firefox-iframe-custom-scroll-bug

andrewjoypappu avatar Feb 13 '17 12:02 andrewjoypappu

+1 since I really find this annoying.

Jeeosch avatar Mar 17 '17 23:03 Jeeosch

Related to #322 fixed with the new iframehelper script (in dist folder)

inuyaksa avatar Jul 14 '17 19:07 inuyaksa

Hi Inuyaksa, thanks for the nice plugin! But It's not working for me when trying to iframe cross origin domain, im using jquery.nicescroll.iframehelper.js, showing this error in chrome:


Uncaught DOMException: Blocked a frame with origin "" from accessing a cross-origin frame. at HTMLBodyElement.onwheel() onwheel @ jquery.nicescroll.iframehelper.js:33


Is it solved? Because for Jeeosch case were within the same domain. Thanks~

sonans202 avatar Jul 20 '17 07:07 sonans202

Hi, with content from other domains is a problem to resolve this issue. Do you have an example I could check?

inuyaksa avatar Jul 20 '17 08:07 inuyaksa

Thanks for the reply! Here is my testing site and code:

This is the page using iframe: http://xidelang.listedcompany.com/test.rev

You can try to mouse hover and scroll the iframe content, the parent window won't scroll but the scroll work just fine when mouse hover outside the iframed content.

This is the content of the iframe using jquery.nicescroll.iframehelper.js: http://samplemynew.listedcompany.com/includes/integration_external_news_summary.html

sonans202 avatar Jul 20 '17 08:07 sonans202

Also having this with a youtube embed.

alana314 avatar Jul 27 '17 17:07 alana314

Youtube use iframes, then wheel events has stealed from iframe undetectable from javascript on page. Old but actual similar issue: https://stackoverflow.com/questions/31418920/vimeo-iframe-stealing-mouse-wheel-event-on-firefox

inuyaksa avatar Aug 02 '17 18:08 inuyaksa

sonans202 Let me give you a try to fix it: insted of using iframe use div:

ccrstudio avatar Jul 02 '20 22:07 ccrstudio