• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

153
Views
JQuery slice() load items after click back button in browser

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.

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error