crazyboybert
Programmer
Hi All
I have a div with the following css
#myDiv{height:100px; overflow:auto; position:relative;}
The height of the content of the div is say 400px so a scrollbar is visible. I want to scroll the div to say 150px down.
I've tried using
document.getElementById("myDiv").scrollTo(0,150);
But get the error
"object doesn't support this property or method"
I'm guessing that you can only use scrollTo on the window object, which if that is the case is really naff! Now I am aware I could create custom scrolling using some nifty manipulation of the divs position and clip properties and then scroll it that way but boy thats a lot of effort for something fairly simple.
Anyone got an easy solution please. This is internal and for IE only so i'm not concerned in the slightest about any cross browser stuff.
Cheers
Rob
Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
I have a div with the following css
#myDiv{height:100px; overflow:auto; position:relative;}
The height of the content of the div is say 400px so a scrollbar is visible. I want to scroll the div to say 150px down.
I've tried using
document.getElementById("myDiv").scrollTo(0,150);
But get the error
"object doesn't support this property or method"
I'm guessing that you can only use scrollTo on the window object, which if that is the case is really naff! Now I am aware I could create custom scrolling using some nifty manipulation of the divs position and clip properties and then scroll it that way but boy thats a lot of effort for something fairly simple.
Anyone got an easy solution please. This is internal and for IE only so i'm not concerned in the slightest about any cross browser stuff.
Cheers
Rob
Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927