I think I'm trying to do something impossible.
I have a <div> element with a overflow style set to "scroll". In other words my <div> element allows the user to scroll the content within it.
There are a number of elements within this <div> that cause the <div> to participate in an Ajax call to the server.
In order to maintain the scroll position of the <div> during the Ajax request I store the scroll value in a hidden field so that when the Ajax request returns to the browser I can call a JavaScript function that retrieves this value and resets the scroll position of the <div>.
Everything's doing what it should except that in some browsers the process is very apparent when the scroll position is reset upon returning from the Ajax request. Let me try to explain this better.
The scroll position of the <div> is set to 0 when the Ajax request returns and then after everything has loaded the JavaScript is called to reset the scroll position to it's last value. There is a Split second where the content is redrawn at the 0 position and when the scroll is reset to it's previous position the content (and scroll bar) "jerks" into the right position.
I am trying to get rid of the "jerkyness" but I have No idea how to solve this problem.
I thought that if I placed the content of the scrollable <div> into another child <div>, that maybe I could set the scroll position of the scrollable <div> before the child <div> loaded but apparently I can't do this. (I cannot set the scroll position larger than the maximum that the content can be scrolled and since the content isn't loaded it's 0 ...so you can see why I'm having problems with this attempt.)
Does anyone have any pointers on how to solve this problem?
Thanks!
-Frinny