• Resolved fkoomek

    (@fkoomek)


    Hello.
    Is somehow possible to enable/disable the scroll to top function by a code? I would like to make this work conditionally. For example, I’d like to disable this function for normal filtering but I would like to scroll to top after the next page of products is load.
    Thanks.

    • This topic was modified 5 years, 5 months ago by fkoomek.
Viewing 1 replies (of 1 total)
  • Thread Starter fkoomek

    (@fkoomek)

    Ok, so I made a custom script for this:

    jQuery('.woocommerce-pagination').click(function() { //when click pages number element
        jQuery(document).one('ajaxStart', function() {
            jQuery('html, body').animate({
                scrollTop: jQuery("#filtercover").offset().top //element to scroll to
            }, 500);
        });
    });
    • This reply was modified 5 years, 5 months ago by fkoomek.
Viewing 1 replies (of 1 total)
  • The topic ‘scroll to top – conditionally’ is closed to new replies.