Chrome - need scroll to appended item

Viewed 308

I have a pagination button (Show More). This button append extra products in the bottom of existed product list, as everywhere. So, then I click on this button in Firefox, new products will apear in front of me, as I need. So, I should scroll down to see (Show More) button again, it's absolutely okey.

But, the same action in Chrome stuck windows in front of (Show More) button. And this is a problem. If I wanna see new products, I should scroll up to check new products and then AGAIN scroll down to see (Show More) button again.

Could you help me? How can i fix this problem in Chrome?

I'm using jquery function append:

$('#product-list').append(response);
1 Answers

Save position before appending and after append scroll to this position.

let scrollPosition = $(window).scrollTop();

// append

$(document).scrollTop(scrollPosition);
Related