I use the slice() function to load more items in the catalog. When I click on an item detail and want to return to the previous page by clicking the Back button in the browser, only the first 15 items are displayed. Is it possible for the page to load at the last position and the user not have to scroll through the items again?
$(function () {
$(".content-inner-wrapper").slice(0, 15).show();
$("#loadMore").on('click', function (e) {
e.preventDefault();
$(".content-inner-wrapper:hidden").slice(0, 15).slideDown();
if ($(".content-inner-wrapper:hidden").length == 0) {
$("#loadMore").fadeOut('slow');
}
$('html,body').animate({
scrollTop: $(this).offset().top
}, 1500);
});
});
Thanks for the advice.