Is there a jQuery technique to select all the page controls/divs with a non-zero scrollbar position?
I’m trying to solve a problem faced by many; essentially after a partial asp.net postback all the controls/divs that had a scrollbar with a non-zero value (ie: were scrolled down to some position) are reset to the zero (top of the scrollbar).
My approach is to have a jQuery script save all the scrollbar positions for all the controls/divs contained on a page and after the postback, restore all the scroll bar positions.
Is it possible, can it even work? If it is, how do I use jQuery to select all the divs with scrollbars and then save those positions.
Thanks!
As far as I know, there is no way to select elements by whether or not they have a scrollbar. If I were to do this, I think my approach would be to target elements that could have scrollbars, then test to see if the scrollTop = 0. For example: