求助高手帮忙,下拉到底部会让尾部的div显示,然后继续下拉尾部又消失了,怎么才能下拉到尾部时,尾部内容能出现,然后滚动条到下面,然后上拉内容消失?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script type="text/javascript">
var MicCase = {
//获取滚动条当前的位置
getScrollTop:function()
{
var scrollTop = 0;
if (document.documentElement && document.documentElement.scrollTop)
{
scrollTop = document.documentElement.scrollTop;
}
else if (document.body)
{
scrollTop = document.body.scrollTop;
}
return scrollTop;
},
//获取当前可视范围的高度
getClientHeight:function()
{
var clientHeight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight)
{
clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
}
else
{
clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
}
return clientHeight;
},
//获取文档完整的高度
getScrollHeight:function()
{
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
}
};
window.onscroll = function (){
var Mic = MicCase;
if (Mic.getScrollTop() + Mic.getClientHeight() == Mic.getScrollHeight())
{
document.getElementById("div2").style.display="block";
document.getElementById("div1").style.fontSize="50px";
document.getElementById("div1").innerHTML="方块";
document.getElementById("div1").style.color = "red";
}
else
{
document.getElementById("div2").style.display="none";
document.getElementById("div1").style.fontSize="100px";
document.getElementById("div1").innerHTML="没有";
document.getElementById("div1").style.color = "yellow";
}
}
</script>
<div id="div1" style="width:1000px; height:1200px; background-color:#00C; font-size:12px">111</div>
<div id="div2" style="width:1000px; height:300px; background-color:red; display:none">222</div>
</body>
</html>
求助高手帮忙,下拉到底部会让尾部的div显示,然后继续下拉尾部又消失了,
怎么才能下拉到尾部时,尾部内容能出现,然后滚动条到下面,然后上拉内容消失?
...全文
相关推荐
iOS仿淘宝详情页弹性上拉下拉效果
只包含上拉下拉效果实现DEMO,不含详情页其他内容布局代码
上拉下拉ListView
这个demo主要实现了listView的上拉拖动刷新和下拉拖动刷新,下拉和新浪微博相似,但是新浪微博没有下拉的特效,非常有用的一个listView效果。这是我开发中用到的一个效果。
RecyclerView上拉隐藏title,下拉显示title
仿TIM主界面的一个Demo,具体实现上拉隐藏标题栏,下拉显示标题栏,只是一个简单的Demo,仅供参考
listview下拉刷新上拉加载
ListView下拉刷新,上拉加载。下拉刷新显示最新更新时间。
JS/jQuery实现DIV延时几秒后消失或显示的方法
本文实例讲述了JS/jQuery实现DIV延时几秒后消失或显示的方法。分享给大家供大家参考,具体如下: 1、最常用的方法(setTimeout): [removed] $(function () { setTimeout(function () { $("divid").show(); }, 6000); }) [removed] 2、第二种方法(delay) jquery 让一个div延时消失,纯jQuery,不用settimeout,就用jQuery写。 <script language=


