<!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显示,然后继续下拉尾部又消失了,怎么才能下拉到尾部时,尾部内容能出现,然后滚动条到下面,然后上拉内容消失?
<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显示,然后继续下拉尾部又消失了,怎么才能下拉到尾部时,尾部内容能出现,然后滚动条到下面,然后上拉内容消失?
解决方案 »
- 高手们,求帮忙!我是个菜鸟,希望各位帮帮我!
- 函数的属性为什么会随方法显示出来?
- {0} 在js脚本中,用正则表达式怎么表示? 我想替换string里的{0}
- 请高手帮我解释一段代码
- 如何在父窗口关闭window.open出来的子窗口?
- 急!!!!!!!如何操作statusbar的长度
- t(".common-submitBtn").attr("title","Ctrl+Enter快捷发表")
- 如何做到单击链接后把文件保存到临时文件夹temp里面,然后打开。
- 如何向一个html页中提交大量数据?post方法不能用于静态页,get方法提交的数据有大小限制,怎么办?
- 有这样的javaScript吗? 希望大家来看看!
- JS判断元素区间
- JS实现表单根据下拉框内容来判断右边表格内容是只读还是可以选择下拉框内容
<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="background-color:red;display:none;position:fix;bottom:0px;">222</div>
</body>
</html>
<!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="background-color:red;display:block;position:fixed;bottom:0;height:300px;width:100%;">222</div>
</body>
</html>