When I trigger a modal view in my page it triggers the scroll bar to disappear. It's an annoying effect because the background page starts moving when the modal moves in / disappears. Is there a cure for that effect?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Better if you will create your own css file to customize a certain part of your bootsrap.
Do not Alter the css file of bootstrap because it will change everything in your bootstrap once you use it in other parts of your page.
If your page is somewhat long, it will automatically provide a scroll bar. And when the modal opened, it will hide the scroll bar because that's what bootstrap do as a default.
To avoid hiding it when modal is opened, just override it by putting the css code (below) on your own css file.
just a vice versa...
Its better to use overflow-y:scroll and remove padding from body, bootstrap modal added padding to page body.
IE browser Compatible, IE browser doing same thing by default.
Additionally, if modal popup needs to scroll with content inside and the parent needs to remain still, add the following to your Custom.css (overriding css)