【发布时间】:2014-01-19 18:51:26
【问题描述】:
我正在制作一个网站,但在使用 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;
}
【问题讨论】:
标签: jquery html css button scroll