View Full Version : Can I scrollBy(100,0) to a target?

01-15-2003, 04:51 PM
Hi everybody.

I was wondering if it is possible to use the scrollby(xx,xx); to scroll to a #target rather then a pre-set distance. Below is a scroll script I wrote. (its not the best, if the speed doesn't devide into the distance evenly it doesn't scroll to the right position)

Hmmm. any ideas?


function scroller(distance,direction){
var i=0
var speed=10
var pixels=speed
if (direction=="back"){ pixels=pixels-(pixels*2) }
while(i < (distance/speed)){

<a href="javascript:scroller(800,'back')" >back</a>

01-15-2003, 05:25 PM
What about scrollTo() ?

scrollTo( parseInt( document.links['yourLink'].offsetLeft ), 0 );

Mr J
01-15-2003, 05:58 PM
See if this helps you out

I created a script whereby you can allocate keywords to run a function that will scroll down or up the page to information relating to that keyword.

To see the script see


The main factor is how the target positions are located.

No fixed positions have been used as the locations are found by using


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum