Open geeyan opened 9 years ago
Hm I guess this is on Windows machines where the scroll bars occupy a space of their own, right?
Is there any way to disable scrolling without having that "shake"?
Yes, windows 7+chrome. see: http://www.zhihu.com/question/21865401/answer/22964112 http://jsfiddle.net/21freestyle/BhRpe/1/
:+1: on this.
I had to delete the following CSS to avoid the page shaking:
body.stop-scrolling {
height: 100%;
overflow: hidden; }
Problem also appears on Windows 10 + chrome + Edge + Firefox
This also happens on Mac when "show scrollbars" is set to "always" in the OS - quite jarring.
+1
I added the following CSS override to the page I was using it. There may be valid cases for changing the height/overflow for use with mobile. (Perhaps this rule should only be performed for desktop users and not with tablet/mobile devices.)
<style type="text/css">
body.stop-scrolling {height:auto !important; overflow:visible !important;}
</style>
Disclaimer: You should modify this to set it to whatever your framework uses and test it on multiple devices, but this may be a better/safer solution than removing the CSS from the plugin's library. (BrowserStack.com is a good tool for previewing the effects using multiple virtual OS/device combinations.)
+1
Consider migrate your project to sweetalert2
This problem, and many others, does not exists there.
Original code will automatically toggle DOM body class "stop-scrolling", cause browser page shake. This will do harm to user experience. I suggest that "stop-scrolling" class as a configurable param.