Javascript, jquery get browser and screen various height widths

Source: Internet
Author: User

Javascript:alert (document.body.clientWidth); //Web page Visible area width (body)alert (document.body.clientHeight); //Web page Visible Area high (body)alert (document.body.offsetWidth); //Web page Visible area width (body), including border, margin, etc.alert (document.body.offsetHeight); //Web page Visible area width (body), including border, margin, etc.alert (document.body.scrollWidth); //page Body full text width, including non-visible area with scroll baralert (document.body.scrollHeight); //The full text of the Web page is high, including the unseen area with scroll barsalert (DOCUMENT.BODY.SCROLLTOP); //Top (scroll bar) of the page being rolled awayalert (document.body.scrollLeft); //Web page is rolled away left (scroll bar)alert (window.screentop); //Browser Distance Topalert (window.screenleft); //Browser Distance leftalert (window.screen.height); //High Screen resolutionalert (window.screen.width); //width of screen resolutionalert (window.screen.availHeight); //the screen can be high on the work areaalert (window.screen.availWidth); //the width of the work area available on the screenJqueryalert ($ (window). Height ()); //Browser Current window viewable area heightalert (document). Height ()); //the height of the browser's current window documentAlert ($ (document.body). Height ()); //the height of the body of the browser's current window documentAlert ($ (document.body). Outerheight (true));//Browser Current Window document body total height includes border padding marginAlert ($ (window). width ()); //Browser Current window viewable area widthalert (document). width ()); //Browser Current Window Document object widthAlert ($ (document.body). width ()); //Browser Current Window document body widthAlert ($ (document.body). Outerwidth (true));//Browser Current Window document body total width includes border padding margin
1<!DOCTYPE HTML>2<Scriptsrc= "Jquery-1.5.1.min.js"type= "Text/javascript"></Script>3<HTML>4<Head>5<title>Aaa</title>6</Head>7<Body>8<H1>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAA 9 AAAAAAAAAAAAAAAAAA</H1>Ten<P>Welcome to AAA</P> One<H1>Aaa</H1> A<H1>Aaa</H1> -<H1>Aaa</H1> -<H1>Aaa</H1> the<H1>Aaa</H1> -<H1>Aaa</H1> -<H1>Aaa</H1> -<H1>Aaa</H1> +<H1>Aaa</H1> -<H1>Aaa</H1> +<H1>Aaa</H1> A<H1>Aaa</H1> at<H1>Aaa</H1> -</Body> -</HTML> the<Scripttype= "Text/javascript"> -alert (document.body.clientWidth); inalert (document.body.clientHeight); -alert (document.body.offsetWidth); toalert (document.body.offsetHeight); +  -alert (document.body.scrollWidth); thealert (document.body.scrollHeight); *  $alert (DOCUMENT.BODY.SCROLLTOP);Panax Notoginsengalert (document.body.scrollLeft); -alert (window.screentop); thealert (window.screenleft); +alert (window.screen.height); Aalert (window.screen.width); thealert (window.screen.availHeight); +alert (window.screen.availWidth); -  $ //alert (document). Height ()); $ //alert (document). width ()); - </Script>

Javascript, jquery get browser and screen various height widths

Related Article

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.