Javascript, jquery get browser and screen various height widths

Source: Internet
Author: User

Javascript, jquery get browser and screen various height widths

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 bar

alert (document.body.scrollHeight); The full text of the Web page is high, including the unseen area with scroll bars

alert (DOCUMENT.BODY.SCROLLTOP); Top (scroll bar) of the page being rolled away

alert (document.body.scrollLeft); Web page is rolled away left (scroll bar)

alert (window.screentop); Browser Distance Top

alert (window.screenleft); Browser distance left

alert (window.screen.height); High screen resolution

alert (window.screen.width); Width of screen resolution

alert (window.screen.availHeight); The screen can be high on the work area

alert (window.screen.availWidth); The width of the work area available on the screen

Jquery:

Alert ($ (window). Height ()); Browser Current window viewable area height

Alert (document). Height ()); The height of the browser's current window document

Alert ($ (document.body). Height ()); The height of the body of the browser's current window document

Alert ($ (document.body). Outerheight (true)); Browser Current Window document body total height includes border padding margin

Alert ($ (window). width ()); Browser Current window viewable area width

Alert (document). width ()); Browser Current Window Document object width

Alert ($ (document.body). width ()); Browser Current Window document body width

Alert ($ (document.body). Outerwidth (true)); Browser Current Window document body total width includes border padding margin

Javascript, jquery get browser and screen various height widths

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.