Is it possible to hide and disable the scrollbar when the lightbox opens, then re enable once it closes or gets clicked away?
I using this short code template if that helps in my page builder.
[image class=“my-video-class” src=“image” link=“true” href=“youtube-link”]
[lightbox selector=".my-video-class"]
I found this code, which works
(function($){
$( “.my-lightbox-link-class” ).click(function() {
$(‘html, body’).css({‘overflow’: ‘hidden’, ‘height’: ‘100%’});
});
})(jQuery);
Then added this below in js customiser with the above,
(function($){
$( “.ilightbox-close” ).click(function() {
$(‘html, body’).removeAttr( ‘style’ );
});
})(jQuery);
but doesn’t re enable the scroll after the lightbox exits which another post suggests it should.
Any suggestions on how I can achieve what I want?