我正在制作一个网站,但是使用jQuery将页面向下滚动100%的按钮有问题.我遇到了麻烦,因为它在浏览器和窗口大小之间滚动不同的空格.我问题的任何解决方案?顺便说一句,这是我的代码……
jQuery的
var screenheight100 = css('height','100%'); $('#gdb1').click(function(){ $("html,body").animate({ scrollTop: (screenheight100)},600); return false; });
HTML
<div class="gdBox"><div id="gdb1" class="gdbutton fontwhitenshadow">Q</div></div>
CSS
.gdBox{width: 100%; height: 35px; position: absolute; bottom: 30px; text-align: center; overflow: visible; } .gdbutton{margin: 0 auto; height: 20px; padding-bottom: 20px; text-align: center; width: 40px; font-family: iconFont; font-size: 45px; cursor: pointer; }