
![]() |
thedarkness
Dudes,
I need a cross browser solution to being able to determine the height of a scrollable window in javascriptso I can position an image in the middle of the visible window regardless of the scrolled position. I can do the width OK and the height of the window without any scolling, but the height once the window starts scrolling has so far eluded me. I have googled this for an hour or so this afternoon but got very little gratification.All donations cheerfully accepted ![]() TIA, td perkiset
This will handle the browser BODY, but not a scrollable div if that's what you're looking for. IF you find a way to interrogate/manipulate the thumb of a scrollable div I've got a 6pack waiting for you pal...
function browserWindowHeight() { if ((document.all) && (document.getElementById)) { return document.body.offsetHeight; } else { return window.innerHeight; } } function browserWindowWidth() { if ((document.all) && (document.getElementById)) { return document.body.offsetWidth; } else { return window.innerWidth; } } |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads