PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

【xiyou请进】 [复制链接]

1#
页面内容不满屏时能不能把页脚定在页面底部啊?
网上有一段JS代码,不知道该放在哪里~
最后编辑jonlon 最后编辑于 2010-03-13 13:59:50
分享 转发
TOP
2#

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();
TOP
3#

("info")和("bottom")应该怎处理??
TOP
4#

版主在吗?
TOP
发新话题 回复该主题