cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.81k forks source link

Support for non-touch devices #249

Closed Dandu-Venkata-Ravi-Varma closed 10 years ago

Dandu-Venkata-Ravi-Varma commented 12 years ago

Perhaps scrolling on devices without touch-support can be done using something like:

function is_touch_device() {
    return !!('ontouchstart' in window);
}

if (!is_touch_device()) {
    //Use non-touch scrolling if device doesn't support it : https://github.com/feedhenry/blackberry-notouch-iscroll/blob/master/client/default/js/init.js
    console.log("No touch support");
    $('.myScrollbarV').unbind().bind('click', function(e) {
        var offsetY = e.offsetY;
        var fullHeight = $('#thelist').height();
        var scrollY = offsetY / $(this).height() * fullHeight;
        myScroll.scrollTo(0, -1 * scrollY, 100);
    });
}

https://github.com/feedhenry/blackberry-notouch-iscroll/

davidpfahler commented 10 years ago

v4 or earlier is unsupported. Please check out v5 if you have this issue.