I am building a website and have problems with a button that uses jQuery to scroll down the page 100%. I have problems because it scrolls different spaces between browsers and window sizes. Any solution to my problem? By the way, here is my code ...
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;
}
source
share