Get a users window scroll value

B

bissatch

Hi,


When I scroll my browser window, how do I get the value in pixels of
how much of the page I have scrolled?


Cheers


Burnsy
 
B

bissatch

Hi,

Thanks, that worked great. I have one more question though.

How do you get the users visible screen width and height. I had a look
on the page you recommended above and it uses document.body.clientWidth
and document.body.clientHeight but this gives me the size of the the
page including that hidden before scrolling down. I just want the
screen size of the visible page. Any page hidden until the user scrolls
down I ont want to include in the measurement.

Any ideas?

Thanks

Burnsy
 
R

RobG

Hi,

Thanks, that worked great. I have one more question though.

How do you get the users visible screen width and height. I had a look
on the page you recommended above and it uses document.body.clientWidth
and document.body.clientHeight but this gives me the size of the the
page including that hidden before scrolling down. I just want the
screen size of the visible page. Any page hidden until the user scrolls
down I ont want to include in the measurement.

You need to be really clear with your terminology here. The 'visible
screen' is the computer screen and will have dimensions like 1024x768
or 1280x1024 etc. If you mean how big is the inside of the browser
window (which is what I think you mean), then heed Peter-Paul's advice:

"Extreme browser incompatibilities ahead."

You need to read the referenced page at quirksmode very carefully and
play on the test pages. The very first script (Inner width) will get
the inner dimensions for IE and most other browsers (they work for me
in IE and Firefox). But do read the associated text and go to the
test pages, you likely won't remember it all but at least you'll
appreciate the effort it must have required to for Peter-Paul to
develop the page.

Use the frameset link and have a look at the other stuff he has there,
it's all good.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,811
Messages
2,569,693
Members
45,474
Latest member
MaggieCoom

Latest Threads

Top