When you use the bootstrap modal modal window component, the trigger will find that the page has a jitter behavior. This is because it hides the browser scroll bar, the page is equivalent to a wide, closed modal window, the page appears again scroll bar, the page has become narrower, this stretch of a contraction will make the page jitter phenomenon. My solution is very simple, is to kill the hidden scroll bar code. In total, delete the 6 lines of code in the Bootstrap.js file.
Take the uncompressed bootstrap.js file in the bootstrap3.3.6 version as an example.
First in 971 rows or so, delete these 3 sentences
- This. Checkscrollbar()
- This. Setscrollbar()
- This. $body. AddClass(' Modal-open ')
The second place is about 1081 lines, also delete 3 sentences
- That. $body. Removeclass(' Modal-open ')
- That. Resetadjustments()
- That. Resetscrollbar()
That's good. It's all about writing unimportant code, adding padding to the body without affecting the operation of other components.
Reprint to: http://www.dijing.me/bootstrap/10.html
Bootstrap open modal modal window causes page jitter resolution