PDA

View Full Version : smooth moving div II - scrollbar



xxlfm
05-15-2007, 05:53 PM
I can get the horizontal scrollbar position by using the following:

Horizontal Scroll
window.pageXOffset
document.documentElement.scrollLeft
document.body.scrollLeft

but can I change window scrollbar position?

This is the followup of http://www.dynamicdrive.com/forums/showthread.php?t=20684

Bob90
05-15-2007, 08:21 PM
Yes, This is common and answered in these forums recently. Please search before you ask a question.

:)

If no luck, post a reply and I will look it up for you.

Bob90
05-15-2007, 08:23 PM
Like here

http://www.dynamicdrive.com/forums/showthread.php?t=20118&highlight=scrollto

:)

xxlfm
05-16-2007, 03:54 PM
Thanks Bob.

Please forgive my ignorance, I will search for sure next time.

at the page http://stylefashions.ca/prototype/runway.php, what I tried to do, when click moving left, I want to user to be able to drag the scrollbar to see the leftmost menu if they want.

when I move the div to left, I want to user to see the mostleft menu.

xxlfm
05-16-2007, 05:50 PM
I used the John's code and it's working on IE using window.scrollBy.



slidex.doit=function() {
window.scrollBy(slidex.x*slidex.speed, 0);
if(slidex.xa>0){
slidex.xa-=slidex.speed;
setTimeout("slidex.doit()", slidex.xa<5*slidex.speed? 30 : slidex.xa<10*slidex.speed? 20 : 15);
}
else
slidex.going=0;
}


want to make it cross browser.....

Bob90
05-16-2007, 07:32 PM
Seems to work in FF 2.

One point I want to make is that you have a 1MB (ONE MEGABYTE) picture on your page. It takes ages to load, even with broadband! Either re-save with a lower quality or make them smaller.

xxlfm
05-17-2007, 03:54 PM
thanks, I am gping to make the images small size.

Is it showing properly in FF? (http://stylefashions.ca/runway1.php)

I tried in all gecko based browser, the images are pushed down, I got check the css..

I found css width: 100&#37; sometimes not working , so I just use the actual size (px), and so far so good.