3

I want when the user scrolls from the bottom to the top of a div to load more items into that div to the top part of the div and I want to maintain the scroll position (or rather make sure the top item before adding more items is still visible after adding the items)

For example if I have item 100 on the top and 100 more items has been loaded into the div then I want item 100 to still be the focus of the scroll position, currently when I add items to the div it jumps to item 200...

I'd love to get help with this issue, thanks in advance :)

123
  • 127
  • 3
  • 18
  • get scroll offset before adding 100 items and set to it again after adding.. this is one way of logic. try to have simple sample and we can help to achive yours – Uthistran Selvaraj Jun 24 '20 at 16:41

1 Answers1

0

I found this answer useful, I just created the same logic but in React jquery - keep window from changing scroll position while prepending items to a list?

123
  • 127
  • 3
  • 18