Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

smooth scroll safari

$('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function (t) {
    if (location.pathname.replace(/^//, "") == this.pathname.replace(/^//, "") && location.hostname == this.hostname) {
        var e = $(this.hash);
        e = e.length ? e : $("[name=" + this.hash.slice(1) + "]"), e.length && (t.preventDefault(), $("html, body").animate({
            scrollTop: e.offset().top
        }, 600, function () {
            var t = $(e);
            if (t.focus(), t.is(":focus")) return !1;
            t.attr("tabindex", "-1"), t.focus()
        }))
    }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to sort array without using sort method in javascript 
Javascript :: jquery when iframe is loaded 
Javascript :: how to set css variables in javascript 
Javascript :: creating a 2d array in js 
Javascript :: react fragment 
Javascript :: not in array js 
Javascript :: node js cross origin error 
Javascript :: get all the child of the same class javascript 
Javascript :: get value from json object in javascript 
Javascript :: math.floor js 
Javascript :: filter out undefined from object javascript 
Javascript :: Remove Duplicates array values in javascript 
Javascript :: jquery select dropdown option 
Javascript :: how to show 1 to 10 odd numbers in javascript 
Javascript :: convert date to string javascript 
Javascript :: replace all character in string javascript 
Javascript :: react inject component into another component 
Javascript :: aws amplify get JWT TOKEN 
Javascript :: how to identify specific letter from a string in javascript 
Javascript :: js pad 2 
Javascript :: Javascript console log a string 
Javascript :: javascript largest number in array 
Javascript :: add tab to textarea 
Javascript :: how to use the onload event n vue js 
Javascript :: uploading file with fetch in js 
Javascript :: default selected radio button angular material 
Javascript :: mongoose join multiple collections 
Javascript :: javascript toisostring without milliseconds 
Javascript :: chartjs begin at 0 
Javascript :: timeout httppost angular 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =