Chorme browser div contains IMG tag page total exceeds browser page height

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.