欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

DivCSS實例:讓頁腳保持在未滿屏頁面的底部_Div+CSS教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
  DivCSS實例:讓頁腳保持在未滿屏頁面的底部

  在內(nèi)容不超過一屏的情況下,當(dāng)瀏覽器窗口變小那行頁腳文字會跟著向上浮動但還是保持在底部。
  當(dāng)內(nèi)容多出一屏?xí)r,他顯示在網(wǎng)頁的最下邊,而不是窗口的最下邊;測試了一下,還可以,在IE6、IE7、FF等都沒有問題!窗口縮小時也沒有問題!

  首先是JS腳本:

示例代碼 [m.dounai2.com]
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();

  查看運行效果:

代碼調(diào)試框 [m.dounai2.com]

[ 可先修改部分代碼 再運行查看效果 ]

  

/所屬分類:Div+CSS教程/更新時間:2008-06-05
相關(guān)Div+CSS教程