How to handle new data addition on infinite scrolling DOM -


i had question thought needed expert advice. have infinitely scrollable div loaded list, 10 @ time. works fine if there no changes in list.

i have form prepends list new item , hence disturbs sequence of infinite scroll i.e. last item in displayed content repeated.

i'd thankful if advice me how handle condition. things tried do,

  1. splicing last item in displayed content. (vague way, not useful if list prepended multiple items)
  2. keeping track of how many items prepended , passing skip = <number_of_prepended_items> argument server skip these newly added items (works fine feel break)
  3. reload first 10 items upon addition of new item.

any suggestions?

as harry pehkonen said, could, example, give each item id value, increment 1 each new element. can request first 10 items after id server, in case lowest id on page (literally). give first 10 items not have , prevent duplicates.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -