javascript - How to scroll an overlay div on mobile -


I have found a mobile website that has a navigation menu that is displayed at the top right click of a certain status button. This menu is also fixed so that the menu is below 10px below the top button. The problem is that this navigation menu may be higher than the device used, and when you try and scroll, this content will scroll behind the navigation menu because it's okay. Can somebody help me out?

According to my comment:

You can search for the upper part of the screen Use JS, set the maximum height of the menu above the menu and the difference between

$ ('window') for the height of the window use.

For the distance of the menu from the top of the browser: $ ('. Menu') offset ()

The menu should stay in the event listener:

  var maxHeight = $ (window) .height () - $ ('. Menu') Offset (); $ ('. Menu') Css ({"max-height": maxHeight})  

Make sure overflow: scroll; Click your menu


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -