Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Scroll to an element with jQuery #9766
    blankrezgar-cadro
    Participant

    A compact version of “animate” solution.

    $.fn.scrollTo = function (speed) {
        if (typeof(speed) === 'undefined')
            speed = 1000;
    
        $('html, body').animate({
            scrollTop: parseInt($(this).offset().top)
        }, speed);
    };
    

    Basic usage: $('#your_element').scrollTo();

Viewing 1 post (of 1 total)