Wednesday, February 13, 2013

Disable Page Scroll on jQueryMobile Popup opens

when JQM popup open, and you dont want to scroll page then try this code.

Disable scroll.
$( ".popup").live({
                      popupbeforeposition: function(event, ui) {
                        $("body").on("touchmove", false);
                      }
});

After close popup release scroll.
$( ".popup" ).live({
                      popupafterclose: function(event, ui) {
                        $("body").unbind("touchmove");
                      }
});

No comments:

Post a Comment