Shahar
Shahar

Reputation: 541

How to avoid jQuery mmenu scroll to top on opening

I'm using mmenu context menu (comes from the bottom of the screen) on a list. when i'm scrolling down the page, and then fires the menu, on the open action the page is scrolled to the top. How can I avoid the scrolling?

Thanks

Upvotes: 4

Views: 616

Answers (1)

mbain
mbain

Reputation: 158

You probably have height: 100% set on your body element. As stated in the docs,

  1. Don't set a height on the HTML.

If you need a DIV to be (at least) 100% height, use

#my-div {
   height: 100vh;
}

This fixed the issue for me.

Upvotes: 2

Related Questions