I don't want user to scroll when any side bar is open. They should scroll once it closed.
I've use below code but its not working on android mobile device
$(document).bind('panelopen', function (e, data) {
$('body').css("overflow", "hidden");
});
$(document).bind('panelclose', function (e, data) {
$('body').css("overflow", "auto");
});
The
overflowoption never worked for me. I had to rely on thetouchmoveevent of thebody. I changed yourpageinitevent to this :So when the panel opens, the
overflowproperty is changed, after which thetouchmoveevent is bound tobody. ThestopScrollfunction, which prevents default action of our touch screen, is bound to thetouchmoveevent of body.When the panel closes, you'll have to
unbindthattouchmoveevent frombodyto restore your scroll.Works on Galaxy S3, Xperia S, Nexus 4 phones and Nexus 7 tablet.
Here's the code at JSBin