I am not sure if question headline is justifying my requirement. But here is what I am facing. I have 50 elements and I am showing it into the batch of 10. And I have next and previous button. So as per my requirement, suppose i am showing 10 element on the page which is 30th-40th element. Also, in my viewport, I am showing 4 elements at a time.
I click on one of the element and the list is removed and new page shows details. and the I went back and shows the 30th-40th element and user clicked previous and I prepend the 20th-30th element. Now, The list is jumped to 20th element. whereas it should show me 26th-29th and then 23rd-25th and then rest. How to stop it from jumping.
i don't know what code should i show, because it's just
$(document).on("click","#prev",function(){
$("#mainElement").prepend(element);
});