Magnific-Popup icon indicating copy to clipboard operation
Magnific-Popup copied to clipboard

Need to disable the scrollbar disabling feature

Open csborgman opened this issue 10 years ago • 6 comments

I'm using custom scrollbars based on nicescroll script and Magnific Popup seems to have a scrollbar disabling feature active when lightbox opens. The problem is the feature, although works great on default browser scrollbar, is shifting the content as the lightbox opens and then closes.

How to disable this feature?

Thank you!

csborgman avatar Jan 26 '15 21:01 csborgman

You might try setting the overflowY option to scroll in order to prevent the scroll bar from disappearing. This is also mentioned in the Known Issues section of the documentation.

bjmiller121 avatar Jan 29 '15 20:01 bjmiller121

i have similar problem because script add to html size of scroll and hidden, not useful. i decide disable part of code when added those options. But those practice won't be useful for all. PS: when added hidden i can scroll content on touch screen. as i see a lot of frameworks add to html overflow-y: scroll it good practice because content don't jumping. if i mistake, please correct me Thanks

ghost avatar Jan 30 '15 10:01 ghost

overflowY:'scroll' didn't seem to fix this for me. The whole content moves anyway.

http://ilkkah.com/2015/02/23/facebook-real-time-updates/

ile avatar Feb 23 '15 14:02 ile

yeah, you can scroll the page put it better than the content will jump all time. Try open close >4 times and you can see how it enrages you.

ghost avatar Feb 23 '15 17:02 ghost

I probably have the same problem. I am unable to assign overflowY: hidden or overflow-y: hidden. After opening and closing the preview image will appear next slider. How to get rid of him, please? translate with Google Translator

http://www.kom72.cz/index.php?stranka=kategorie_vypis&kategorie_id=3

kom72 avatar Mar 06 '16 03:03 kom72

this is old, but OP was referring to the scroll being hidden on the page because the script adds overflow hidden to the html element of your page. The overflowY: 'scroll' setting has to do with the scroll within the inside of your popup. to prevent magnific from jacking the scrolling of your page this will work.

callbacks: {
    open: function() {
      $('html').css('overflow', 'auto').css('margin-right', '0');
    },
  }

nickfmc avatar Jul 08 '19 18:07 nickfmc