2008年3月24日星期一

网站建设让底部保持在还未满的页脚代码

转自网站建设

直接看代码和运行效果吧:
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();

没有评论: