devolkpl / chromeSmoothScroll

Smooth scrolling for chrome browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chromeSmoothScroll

Smooth scrolling for chrome browser (it's less than 2 KB)

usage

Just inlcude the js, you are done!

<script src="path/to/chromeSmoothScroll.js"></script>

demo

http://habibhadi.com/demo/chromeSmoothScroll/

Tips

If you want to turn smooth scrolling for specific OS then you may try like this -

var OS = {
    isWindows: function(){ return navigator.appVersion.indexOf("Win")!=-1 },
    isMac: function(){ return navigator.appVersion.indexOf("Mac")!=-1 },
    isUnix: function(){ return navigator.appVersion.indexOf("X11")!=-1 },
    isLinux: function(){ return navigator.appVersion.indexOf("Linux")!=-1 },
    name: function(){
        var name = '';
        if(OS.isWindows()) name = "windows";
        else if(OS.isMac()) name = "macosx";
        else if(OS.isUnix()) name = "unix";
        else if(OS.isLinux()) name = "linux";
        return name;
    }
};


if( OS.name() == 'windows' ) {
    // this function called at the end of the js file!
    chromeSmoothScroll.init();
}

About

Smooth scrolling for chrome browser


Languages

Language:JavaScript 97.1%Language:HTML 2.9%