我正在使用 $(document).height() 動態分配背景的高度。
為什么點擊檔案時背景影像會增加它的高度?檔案高度相同
function setDocumentHeight(){
var height = $(document).height(); console.log("Document Height " height);
$(".bg").css({"height":height});
}
setDocumentHeight();
$(document).click(function(e) {
if (e.button == 0) { setDocumentHeight(); }
});
https://jsfiddle.net/jd8n6qa9/
uj5u.com熱心網友回復:
將頂部和底部 0 設定為絕對背景。它將解決這個問題。
.bg {top:0;bottom:0;}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/336953.html
標籤:javascript 查询 css
