A little help please...
I have a <div> (let's call it divName), and I want to store its scroll position in a hidden variable (let's call it nameCoOrd). I store its scroll position using:
This seems to work fine in both FireFox and IE.
Now, I do some changes to the <div> (using JavaScript), and I want to restore the scroll position, so I use
This seems to work properly in FireFox, but in IE, the <div> always scrolls to the position 214. However, if I give an alert statement like
before reseting the scrollTop, it works properly. I am completely stumped by this problem, and any help will be greatly appreciated. Thanks in advance!
rrjammy.
I have a <div> (let's call it divName), and I want to store its scroll position in a hidden variable (let's call it nameCoOrd). I store its scroll position using:
Code:
document.formName.nameCoOrd.value = document.getElementById('divName').scrollTop;
This seems to work fine in both FireFox and IE.
Now, I do some changes to the <div> (using JavaScript), and I want to restore the scroll position, so I use
Code:
document.getElementById('divName').scrollTop = document.formName.nameCoOrd.value;
This seems to work properly in FireFox, but in IE, the <div> always scrolls to the position 214. However, if I give an alert statement like
Code:
alert(document.formName.nameCoOrd.value);
before reseting the scrollTop, it works properly. I am completely stumped by this problem, and any help will be greatly appreciated. Thanks in advance!
rrjammy.