- Create Account

How to get the pixel height of the page (not window)?

Forums > Cross-Browser DHTML API > How to get the pixel height of the page (not window)?
Author
Message

1) SyphonFi Group: Guests
IP: 212.199.--.--
Hi,

I really like using your scripts - they're highly optimized and very intuivtive.

I'm trying to extend the page object to support to new properties - the pixel width and pixel hight of a page. (page.winW() and page.winH() return the window size).

I know IE supports scrollWidth and scrollHeight for this purpose and that I'm supposed to use document.width or document.height on other browsers, but this does not take into account absolutely positioned elements.

Is  there any way of calculating the total width and height of a page, while taking into account absolutely positioned elements, using non-IE browsers (such as NS6+ and Opera)?

2) Angus Turnbull Group: Guests
IP: 210.54.--.--
The "Layer API" script itself does include some additional functions for detecting page dimensions, but I just haven't used them by default in any of the main scripts. Download it if you haven't already and try calling them...? They might not work brilliantly in pre-v7 Opera versions from memory but your luck may be better.

- Angus.

3) C bradley Group: Guests
IP: 67.8.--.--
Nice Scripts...

Have Everything correct ..except that i need to adjust the width and position of menu.
much thanks
cb

4) Sean Group: Guests
IP: 24.216.--.--
Love this drop down menu. This is my first time using one and this is the best one I have been able to implement so far. My only problem is that I cannot figure out how to adjust the width and position of the menu. I want it to stay on a single line insead of dropping into a second line (regardless if side scrolling is necessary), be approx. 760px total, and center in the middle of the page when resized.

Please  talk to me like a beginner, because I really have very little experience with coding in general. Any help would be really appreciated.

-Sean

5) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.173.--.--
OK, it would help if you mentioned which of my menu scripts you were using, and/or posted in one of the forums specifically for those scripts!

If you're using the FreeStyle Menu script, put it inside a centred element on your page (that's the easiest way) and ensure its container is large enough to fit all your menu items in it.

For the Cascading Menus, see its "pop_syntax.html" document for centring the script.

Good luck - Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.