Alibabacloud.com offers a wide variety of articles about documentelement clientwidth, easily find your documentelement clientwidth information here online.
. To implement this function, the key lies in the calculation of the element size in the page. See the following code:
Script Language = "JavaScript" Type = "Text/JavaScript"> Function Getclientbounds () { VaR Clientwidth; VaR Clientheight; If ($. Browser. MSIE) { Clientwidth = Document. Body. clientwidth; Clientheight = Document. Body. cli
, we need to make the chat dialog box of Web Live Messenger always display within the visible range of the page. To implement this function, the key lies in the calculation of the element size in the page. See the following code:
Function getclientbounds (){VaR clientwidth;VaR clientheight;If ($. browser. MSIE){Clientwidth = Document. Body. clientwidth;Clientheig
. ( "innerheight=" ,innerheight console. ( "outerwidth=" ,outerwidth console. ( "outerheight=" ,outerheight Chrome browser effectsCode:Console.Info("Screen.width=",Screenwidth); console. ( "screen.height=" ,screen height); console. ( "screen.availwidth=" ,screenavailwidth); console. ( "screen.availheight=" ,screenavailheight Effect in Chrome browserWindow related wide browser compatibility issuesInnerheight and Outerheight do not support the following versions of IE9, w
The page needs to be nested in the Cross-origin iframe, but the page height is not fixed. After each page obtains its own height, it uses js to notify iframe to adjust the display.
When the page obtains its own height, it is always larger than expected. After referring to others' blogs, I found that it was originally the w3c standard.
That is, add
After adding, document.doc umentElement. scrollHeight can be properly obtained under IE and Chrome, but it is too high in firefox. The opposite is tr
/********************* Take the height of the window scroll bar******************/Function getscrolltop (){VaR scrolltop = 0;If(document.documentelementdocument.doc umentelement. scrolltop){Scrolltop=document.doc umentelement. scrolltop;}Else if (document. Body){Scrolltop = Document. Body. scrolltop;}Return scrolltop;}
/********************* Take the height of the visible window range*******************/Function getclientheight (){VaR clientheight = 0;If(document.body.clientheightdocument.doc um
Added online test results yesterday! After opening the JS pop-up box, the position and effect are incorrect! But I can test it locally! After careful check, I found that the type of the HTML document in the blog garden is different from that in mine.
Mine is:
Blog:
For HTML document type reference: http:// I .wanz.im/2010/05/28/why_doctype_html/
Check and find that JS obtains the visible size of the current page, which is different from the scrolling position of the page!
The DIV conta
. First, compare the existing version with the latest version. If the latest version is found, the system prompts you whether to upgrade the version. Of course, some people use other properties to compare the file size, for example, file size. :) Or update date.What is the implementation method? In the VB age, I used the XMLHTTP + Inet control. Use XMLHTTP to obtain information, use Inet to transmit the upgrade file, and use a simple BAT file to implement the upgrade.Public sub checkupdate ()On
From: http://blog.csdn.net/renpinghao/article/details/6246651
Obtain the size of the visible area of the browser at a.m.
// Available in IE, Firefox, and operaDocument. Body. clientwidthDocument. Body. clientheight// It can be obtained, which is very simple and convenient.// In the company project:// Opera is still in useDocument. Body. clientwidthDocument. Body. clientheight// However, ie and Firefox useDocument.doc umentelement. clientwidthDocument.doc umentelement. clientheight// It
. clientwidthDocument. Body. clientheightIt is very simple and convenient.In the company's projects:Opera is still in useDocument. Body. clientwidthDocument. Body. clientheightHowever, ie and Firefox useDocument.doc umentelement. clientwidthDocument.doc umentelement. clientheightIt turned out to be W3C standards.If this line is added to the page
In ie:Document. Body. clientwidth ==> body object widthDocument. Body. clientheight ==> body object heightD
In my local test:In IE, Firefox And opera.Document. Body. clientwidthDocument. Body. clientheightIt is very simple and convenient.In the company's projects:Opera is still in useDocument. Body. clientwidthDocument. Body. clientheightHowever, ie and Firefox useDocument.doc umentelement. clientwidthDocument.doc umentelement. clientheightIt turned out to be W3C standards. Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">If this line is added to the pageIn ie:Document. Body.
Label: blog HTTP color Io ar use Java SP Div
A little research on obtaining the visible window size of various browsers
In my local test:It can be used in IE, Firefox, and operaDocument. Body. clientwidthDocument. Body. clientheightIt is very simple and convenient.In the company's projects:Opera is still in useDocument. Body. clientwidthDocument. Body. clientheightHowever, ie and Firefox useDocument.doc umentelement. clientwidthDocument.doc umentelement. clientheightIt turned out to be W3C stan
and left values. You need to obtain the height and width of the visible area of the browser.
// Available in IE, Firefox, and operaDocument. Body. clientwidthDocument. Body. clientheight// It can be obtained, which is very simple and convenient.// In the company project:// Opera is still in useDocument. Body. clientwidthDocument. Body. clientheight// However, ie and Firefox useDocument.doc umentelement. clientwidthDocument.doc umentelement. clientheight// It turned out to be W3C sta
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.