Page 1 of 1

How to disable vertical scroll when left panel is open?

Posted: Sat May 30, 2015 5:51 am
by Shaun7189763

Hello,

I would like to know how I can prevent a page of my app, and the left menu panel, to scroll down when the left menu panel is open.

I have tried the following solution :
https://getsatisfaction.com/apperyio/...
but it doesn't work. In fact it blocks the page from scrolling down as long as the panel is not open. As soon as the panel is open, the page can be scrolled dow again.

In the following capture you see that I can open the panel, and what happens when I scroll with panel open (panel and content can be scrolled down):

Image

Image

Thansk in advance for your help,

Shaun


How to disable vertical scroll when left panel is open?

Posted: Sat May 30, 2015 10:28 am
by Serhii Kulibaba

Hello Shaun,

Please add CSS property overflow:scroll; on "panel open" event and remove it on "panel close" event.

https://developer.mozilla.org/en/docs...


How to disable vertical scroll when left panel is open?

Posted: Sat May 30, 2015 1:40 pm
by Shaun7189763

Sergiy,

I have applied the css property on as on attached image, but with no effect. I still have the problem:

Image

Any other suggestion?

Best regards,

Shaun


How to disable vertical scroll when left panel is open?

Posted: Sun May 31, 2015 12:49 am
by Illya Stepanov

Hi Shaun -

Try with this code:

pre
codeApperyio("panel_3").css("overflow", "scroll");/code
/pre


How to disable vertical scroll when left panel is open?

Posted: Sun May 31, 2015 8:22 am
by Shaun7189763

Illya,

I have tried your suggestion but it has no effect :

The page can still be scrolled down when the panel is opened.


How to disable vertical scroll when left panel is open?

Posted: Mon Jun 01, 2015 8:37 am
by Shaun7189763

The solution was :

on "panel open" event:

$(document).bind('touchmove', function(e){
e.preventDefault();
});

On "panel open" close:

$(document).unbind('touchmove');

Thx,

Shaun