Assume the viewport is 100×100 (width × height), the document is empty, the scroll position is (0,0) (x,y).
body.appendChild
an element A of size 100×200- Now scroll to (0,100) manually
- Some javascript now removes A and
body.appendChild
s B (100×50) - The browser detects that the total document height is 50 and scrolls back to (0,0)
- Some time passes (~150ms)
- Some javascript removes B and
body.appendChild
s C (100×200 again)
Now the browser is still scrolled at 0,0. I'm looking for a solution/library/jQueryPlugin (nothing that i have to insert at 3 and 6) to prevent (4) from happening for a custom defined threshold (in this case ~150ms).