How can I implement smooth scroll to top in a ajax extension that does pagination. The extension has the code following

if (block && amshopby_scroll_to_products) {

and I have following code in my theme phtml which does smooth scroll to top functionality. Is it possible to call this functionality from the extension js file mentioned above.If not what is the the solution to implement?

    var windowScroll_t;

        windowScroll_t = setTimeout(function() {

            if ($(this).scrollTop() > 100)

        }, 500);


        $("html, body").animate({scrollTop: 0}, 600, "easeOutCubic");
        return false;

2 Answers 2


You probably use Amasty module, I had the same problem. There is hidden option in amshopby-ajax.js just change false to true. and ajax filtering will scroll to top

var amshopby_toolbar_selector = 'div.toolbar';
var amshopby_scroll_to_products = false;

Though this question is not related to magento at all but, I love to answer this question,

use this Jquery plugin , and integrate in product view page. see its demo and how to implement section you will easily integrate this beautiful plugin.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.