Best way to prevent page scrolling on drag (mobile)

 window.onmousedown= function (e) {
           if (isTouchDevice()) {
                $(document).on('touchstart', function (e) {
                    e.preventDefault();
                });
            }
}

 window.onmouseup = function (e) {
    $(document).off('touchstart');
}

Comments

Post a Comment

Popular posts from this blog

Scroll After Fixed Navigation

Bootstrap CSS Customize with SCSS CSS