How to disable scrolling on the main page, while lightbox popup is open?

1.1k Views Asked by At

This is the first time I am using Lightbox plus Colorbox plugin for Wordpress and it works very well, except for the scrolling. I am using a wordpress theme, that has full section scrolling. When the Lightbox popup opens, the background parent sections page scrolls with the lightbox popup. I used the following code to disable it, as suggested in their FAQ:

    $(document).on('cbox_open', function() {
    $('body').css({ overflow: 'hidden' });
    }).on('cbox_closed', function() {
    $('body').css({ overflow: '' });
    });​

But this doesn't work. I wonder if the problem is something to do with the section scrolling in the theme used.

Any help/info will be very helpful!

0

There are 0 best solutions below