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(); }
});
set top and bottom 0 to absolute background. it will solve this issue.
.bg {top:0;bottom:0;}