height:100% overflow:scroll doesn't work on smartphone

Asked 2 years ago, Updated 2 years ago, 130 views

When I set the submenu in css as follows, the scroll stops in the middle of the submenu on my smartphone, and
The rest of the sub cannot scroll until you have finished scrolling through the body part.
How should I deal with it?

#submenu{
  height —100%;
  width —80%;
  overflow:scroll;
}

css mobile

2022-09-30 20:22

1 Answers

Is it the image that when you button something, the menu opens and the menu is displayed vertically?
If it's okay to stop scrolling through the main unit while the menu is open, why don't you do that?

body.locked{
 overflow-y — hidden;
}
/* Add this class to the body when the menu is open*/
#submenu{
  height —100%;
  width —80%;
  overflow —auto;
  position:fixed;
  z-index:100;
}


2022-09-30 20:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.