我是靠谱客的博主 朴素篮球,这篇文章主要介绍js让一行页脚保持在底部,现在分享给大家,希望可以做个参考。

测了一下,还可以,在IE6、IE7、FIREOFX等都没有问题! 窗口缩小时也没有问题!

复制代码 代码如下:

<script language="JavaScript" type="text/javascript">
function test(){
 var infoHeight = document.getElementById("info").scrollHeight;
 var bottomHeight = document.getElementById("bottom").scrollHeight;
 var allHeight = document.documentElement.clientHeight;

 var bottom = document.getElementById("bottom");
 if((infoHeight + bottomHeight) < allHeight){
  bottom.style.position = "absolute";
  bottom.style.bottom = "0";
 }else{
  bottom.style.position = "";
  bottom.style.bottom = "";
 } 

 setTimeout(function(){test();},10);
}
test();
</script>


[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

最后

以上就是朴素篮球最近收集整理的关于js让一行页脚保持在底部的全部内容,更多相关js让一行页脚保持在底部内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(196)

评论列表共有 0 条评论

立即
投稿
返回
顶部