Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery scroll to element in scrollable div

jQuery.fn.scrollTo = function(elem, speed) { 
    $(this).animate({
        scrollTop:  $(this).scrollTop() - $(this).offset().top + $(elem).offset().top 
    }, speed == undefined ? 1000 : speed); 
    return this; 
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #scroll #element #scrollable #div
ADD COMMENT
Topic
Name
3+7 =