<div style= "display:block;position:absolute;left:0px;top:0px;" id= "backgroundimg" ></div>js is as follows: $ (function () { $ (document). Ready (function () { alert (window). Width () + "," +$ (window). Height ()), $ ("#backgroundImg"). CSS ({ width:finddimensions (). Winwidth,height:finddimensions (). winheight }); $ (Window). On ("Resize", function () { $ ("#backgroundImg"). CSS ({ width:finddimensions (). Winwidth,height:finddimensions (). winheight }) &NBSP;&NBSP); <!-- Get the browser frequency screen width high parameter --> function getwinscale () { defaults = {winwidth:$ (window). Width (), winheight:$ (window). Height ()}; return defaults; } function finddimensions () { //function: Get dimensions//Get window width if (window.innerwidth) winWidth = window.innerWidth; else if ((document.body) && (document.body.clientWidth)) winwidth = document.body.clientwidth; //Get window height if (window.innerheight) winHeight = window.innerheight; else if ((document.body) && (document.body.clientHeight)) winheight = document.body.clientheight; //detects the body by deep inside the document and gets the window size if ( document.documentelement && document.documentelement.clientheight && Document.documentElement.clientWidth) { winHeight = document.documentElement.clientHeight; winwidth = document.documentelement.clientwidth; } defaults = {winwidth: winwidth,winheight:winheight};return defaults; }
The page always exceeds the browser page height,
Workaround:
Add a style to the IMG parent container div: font-size:0px;
This article is from the "I Am a farmer" blog, please make sure to keep this source http://xiangyeye.blog.51cto.com/9584869/1660786
Chorme browser div contains IMG tag page total exceeds browser page height