Last active
August 2, 2018 16:51
-
-
Save bulbul84/a81b46b90f05f4e8de28cabded8f2fc7 to your computer and use it in GitHub Desktop.
Magnific Popup Jumping Problem Fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.open-link').magnificPopup({ | |
type: 'image', | |
closeOnBgClick: true, | |
fixedContentPos: false, | |
callbacks: { | |
open: function() { | |
jQuery('body').addClass('noscroll'); | |
}, | |
close: function() { | |
jQuery('body').removeClass('noscroll'); | |
} | |
} | |
}); | |
Finally, create a CSS rule for noscroll as : | |
body.noscroll { | |
overflow-y: hidden!important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment