css - Disable scrolling of behind layers on touch devices -


I am creating a side navigation that pops out and it works fine, but the problem occurs when Translate3d is used when chrome is scrolling using an iPhone or emulation mode, behind it & lt; Body & gt; will scroll, it seems that my finger presses through the layer

On the desktop browser on the mobile width it really works properly. Navigation appears, scrolling is off in the navigation pane and background elements are not scrollable.

I think this could be due to translate3d and how does it z -index ? But this is a poorly educated guess.

Here I am working with:

 . Side-nav - fixed {position: fixed; Width: 230px; Include @media-query (palm) {width: 100%! Important; Status: Sure! Important; Top: 125px; Correct: 0; Bottom: 0; Left: 0; Z-index: 5555; Background color: #fff; Overflow-y: scroll up; -MMS-overflow-style: none; -Widk-overflow-scrolling: touch; Include @conversion (translation 3D (-100%, 0, 0)); Include @ Single-Infection (change easily with 1s); @ Extension% ui-shadow; & Amp; :: - WebKit-Scrollbar {Display: None; } & Amp ;. Animate {@ included conversion (translation 3D (0%, 0, 0)); Include @ Single-Infection (change easily with 1s); }}} .no-scroll {position: fixed; } $ ('Body'). ('Click', '.js-side-nav-toggle', function (ev) {$ ('html, body') ToggleClass ('no-scroll');});  

To summarize quickly: I bring a layer using translate3d, then I want to restrict scrolling and ontouch events to that layer and ignore all the elements behind it Will go

Thank you for your time.


Edit:

I Status: Fixed; I'm able to fix it by adding to which is applied when the menu toggle is clicked on html and body . it was done. I updated my code with a work code.

I am able to fix this by adding a position: fixed; When the menu toggle was clicked then the .no-scroll which was applied to the html and body. I updated my code with the working code above

 . Side-nav - fixed {position: fixed; Width: 230px; Include @media-query (palm) {width: 100%! Important; Status: Sure! Important; Top: 125px; Correct: 0; Bottom: 0; Left: 0; Z-index: 5555; Background color: #fff; Overflow-y: scroll up; -MMS-overflow-style: none; -Widk-overflow-scrolling: touch; Include @conversion (translation 3D (-100%, 0, 0)); Include @ Single-Infection (change easily with 1s); @ Extension% ui-shadow; & Amp; :: - WebKit-Scrollbar {Display: None; } & Amp ;. Animate {@ included conversion (translation 3D (0%, 0, 0)); Include @ Single-Infection (change easily with 1s); }}} .no-scroll {position: fixed; } $ ('Body'). ('Click', '.js-side-nav-toggle', function (ev) {$ ('html, body') ToggleClass ('no-scroll');});  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -