...

View Full Version : Scrollbar as a percentage



jayemvee
06-06-2007, 12:22 AM
Does anyone know how to accomplish this?

I've done it but the document.body.scrollTop surpasses clientHeight?

Is there something special I need to do?
Here's what I have that doesnt work


if (navigator.appName == "Microsoft Internet Explorer"){var currentLocation = document.body.scrollTop;}
else{var currentLocation = window.pageYOffset; }

var windowHeight = document.body.clientHeight;

var percentage = currentLocation/windowHeight * 100;

jayemvee
06-08-2007, 10:59 AM
Can this even be done?

GSimpson
06-09-2007, 01:43 PM
I'm personally not sure but I don't think that it would be a good way to have your UI anyway. Usually websites that rely on javascript like dropdown menus for navigation (<option>) and things like buttons for navigation and alerts on welcome can be a real put off to your website, as it comes across on a non-personal level.

jayemvee
06-14-2007, 07:02 PM
I'm personally not sure but I don't think that it would be a good way to have your UI anyway. Usually websites that rely on javascript like dropdown menus for navigation (<option>) and things like buttons for navigation and alerts on welcome can be a real put off to your website, as it comes across on a non-personal level.

I'm trying to do something similar to dzone dot com.

The goal is when the scrollbar reaches the bottom to populate more results.

Thanks

rnd me
06-15-2007, 08:30 AM
the scrollbars don't have standard events, so there is no easy way to do this.

you might try putting a clear span, abs positioned over the bottom portion of the select. give that span a 'onmouseover' event to do what you need it to. make sure that the span is only a couple pixels tall, else you might interfere with the select on ff/safari.

you can figure the bottom by carefull setting of the style attributes. use "px" to set the font height, multiply byt size, and add border/padding widths.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum