Shaun7189763
Posts: 0
Joined: Sun Oct 26, 2014 8:16 am

How to disable vertical scroll when left panel is open?

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

How to disable vertical scroll when left panel is open?

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...

Shaun7189763
Posts: 0
Joined: Sun Oct 26, 2014 8:16 am

How to disable vertical scroll when left panel is open?

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to disable vertical scroll when left panel is open?

Hi Shaun -

Try with this code:

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

Shaun7189763
Posts: 0
Joined: Sun Oct 26, 2014 8:16 am

How to disable vertical scroll when left panel is open?

Illya,

I have tried your suggestion but it has no effect :

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

Shaun7189763
Posts: 0
Joined: Sun Oct 26, 2014 8:16 am

How to disable vertical scroll when left panel is open?

The solution was :

on "panel open" event:

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

On "panel open" close:

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

Thx,

Shaun

Return to “Issues”