I am using the $(document).height() to assign dynamically the height to a background.
Why occurs that when the document is clicked the background image increase it height? The document height is the same
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/
CodePudding user response:
set top and bottom 0 to absolute background. it will solve this issue.
.bg {top:0;bottom:0;}