Loading Page
Toolbar
Hello Guest
Google Search
search
categories
css
css
html
html
javascript
javascript
    »   Dimensions
    »   Implementations
    »   Menu
    »   Images
    »   Text effects
photoshop
photoshop
php
php



Paypal
Do you have something to do in code, design or animation and you don't know how?
Send us an e-mail and will do a tutorial which will solve your problem.

10 Random Tutorials from all categories and subcategories
tutorials U-Trade
tutorials U-Trade
Dimensions for screen, window and document : U-Trade
+ Share and Enjoy
Author: Cristea Iulian



Vote up
Vote down
Vote this article
How many times you met that situation when you need to use a javascript code for getting a size of a specific part of the window or document or object from window? What can I say about the differences between browsers? This is far away from reality? Well ... not really. From here you can take some snippets of code for using in your web page as need it. This may work on other browsers and lower version of Intenet Explorer but we did not test them.

Rulers

No. Code Description Firefox IE >=6.0
1 screen.width Screen width resolution x x
2 screen.height Screen height resolution x x
3 screen.colorDepth Screen color depth x x
4 screen.availWidth Available width, except docking bars for example x x
5 screen.availHeight Available height space, except docking bars for example x x
6 screen.availLeft Width used by docking bars for example x
7 screen.availTop Height used by docking bars for example x
8 window.screenX Position of the window on X axe: x
9 window.screenY Position of the window on Y axe: x
10 window.screenLeft Left position of document on the screen (not of the window) x
11 window.screenTop Top position of document on the screen (not of the window) x
12 window.innerWidth The interior width of a window x
13 window.innerHeight The interior height of a window x
14 window.pageXOffset Pixels the current document has been scrolled from the left corner of the window x
15 window.pageYOffset Pixels the current document has been scrolled from the upper corner of the window x
16 document.body.clientWidth Document size for visible width x x
17 document.body.clientHeight Document size for visible height x x
18 document.body.offsetWidth Document size (visible width) x x
19 document.body.offsetHeight Document size (visible height) - still this is not concludent x x
20 document.documentElement.clientWidth Width body document size visible and over the scroll x x
21 document.documentElement.clientHeight Height body document size visible and over the scroll x x
22 document.documentElement.scrollTop Pixels of scroll until top x x
23 document.documentElement.scrollLeft Pixels of scroll until left x x




U-Trade © All rights reserved 2006-2008