Javascript:ScrollTo() problem in IE6 and its Solution

Problem:

Recently i faced a problem in scrolling window to a particular position in IE6. For scrolling window the Javascript method scrollTo(xOffset, yOffset) is used. but it does not work at IE6. ex.

window.scrollTo(0,200);


and this wont do anything at IE6.

Solution:
after some googling i found an interesting solution as follows.
use scrollTo from a timer and it will work. ex.

setTimeout('window.scrollTo(0, 200)',1);

Cheer$

Leave a comment