滚动超过一定高度 显示返回顶部
window.onscroll = function(){
var t = document.documentElement.scrollTop || document.body.scrollTop;
var top_div = document.getElementById( "top_div" );
if( t >= 200 ) {
top_div.style.display = "block";
} else {
top_div.style.display = "none";
}
window.onscroll = function(){
var t = document.documentElement.scrollTop || document.body.scrollTop;
var top_div = document.getElementById( "top_div" );
if( t >= 200 ) {
top_div.style.display = "block";
} else {
top_div.style.display = "none";
}
}
//滚动的距离
function getScrollTop()
{
var scrollTop=0;
if(document.documentElement&&document.documentElement.scrollTop)
{
scrollTop=document.documentElement.scrollTop;
}
else if(document.body)
{
scrollTop=document.body.scrollTop;
}
return scrollTop;
}
///是否滚动到了页面底部
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
alert('bottom!!');
$("body").css("height",($("body").height()+300)+"pxs");
}
});