Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Horizontal scroll to anchor

$(document).ready(function() {

    $('ul>li>a').bind('click',function(event){
        var $anchor = $(this);

        $('html, body').stop().animate({
            scrollLeft: $($anchor.attr('href')).offset().left
        }, 1000);
        event.preventDefault();
    });

});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Horizontal #scroll #anchor
ADD COMMENT
Topic
Name
5+4 =