Search
 
SCRIPT & CODE EXAMPLE
 

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();
    });

});
Comment

PREVIOUS NEXT
Code Example
Javascript :: unicons add all icons 
Javascript :: generate random email account javascript 
Javascript :: how to process string calculation in gdscript 
Javascript :: Six escape sequences are valid in JavaScript 
Javascript :: template literal inside a key in react 
Javascript :: object destructuring in javascript 
Javascript :: Expresiones regulares para diferentes tipos de campos de formularios 
Javascript :: reactjs moment to string 
Javascript :: nodejs: redirect path to specific path 
Javascript :: mobile angular service 
Javascript :: change on id 
Javascript :: javascript alert when site page opened not in chrome 
Javascript :: DataTables warning: table id=datatable - Ajax error 
Javascript :: react native countdown 
Javascript :: json validate 
Javascript :: inertia.js 
Javascript :: kafkajs 
Javascript :: react native qr code scanner 
Javascript :: constructer 
Javascript :: fuzzy search javascript 
Javascript :: array and array compare 
Javascript :: what are the comparison operators in javascript 
Javascript :: Difference Between for...of and for...in Statement 
Javascript :: array example 
Javascript :: javascript canvas load image 
Javascript :: lottie npm 
Javascript :: javascript callbacks 
Javascript :: discord.js give role command 
Javascript :: post json array data curl 
Javascript :: npm passport-instagram 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =