admin管理员组文章数量:1415467
Is there a simple way to do this? I have a website with a flip animation(on buttonclick), wich has two sides. The frontpage has to cover the viewport height and width. The backpage is a little longer, especially on mobile devices. Unfortunately the length of the backpage causes the frontpage to be the same height. So i have a grey background color area underneath the cover of the frontpage..
My idea was to make the flip button also enable and disable scrolling. I've tried some things but javascript and jquery are not my specialty(at all). So can somebody provide me a little piece of code to add to the flipbutton?
Is there a simple way to do this? I have a website with a flip animation(on buttonclick), wich has two sides. The frontpage has to cover the viewport height and width. The backpage is a little longer, especially on mobile devices. Unfortunately the length of the backpage causes the frontpage to be the same height. So i have a grey background color area underneath the cover of the frontpage..
My idea was to make the flip button also enable and disable scrolling. I've tried some things but javascript and jquery are not my specialty(at all). So can somebody provide me a little piece of code to add to the flipbutton?
Share Improve this question asked Apr 13, 2015 at 14:10 ErickErick 151 silver badge8 bronze badges 2- 1 Google "disable scrolling js" > stackoverflow./questions/4770025/… > jsbin./disable-scrolling/1 – SubjectCurio Commented Apr 13, 2015 at 14:12
- Thanks. I allready saw that one though.. Couldnt get it to work unfortunately because you can still scroll on mobile devices.. :( – Erick Commented Apr 13, 2015 at 14:46
2 Answers
Reset to default 2You'll need to set this on the click event:
body {
overflow: hidden;
}
Here's an example.
I presume you could set the overflow: none on the div you want to stop scrolling (or the body) when the button is clicked.
本文标签: javascriptEnabledisable scrolling on button clickStack Overflow
版权声明:本文标题:javascript - Enabledisable scrolling on button click - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745189793a2646858.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论