How can I make the website acts like a mobile/iPad in scrolling behavior, so that instead of selecting text while clicking and moving the pointer, the website should scrolls/swipes according in the same directions.
Thanks in advance
How can I make the website acts like a mobile/iPad in scrolling behavior, so that instead of selecting text while clicking and moving the pointer, the website should scrolls/swipes according in the same directions.
Thanks in advance
There's a demo of this here it basically involves updateing the scroll position on mousemnove:
var clicked = false, clickY;
$(document).on({
'mousemove': function(e) {
clicked && updateScrollPos(e);
},
'mousedown': function(e) {
clicked = true;
clickY = e.pageY;
},
'mouseup': function() {
clicked = false;
$('html').css('cursor', 'auto');
}
});
var updateScrollPos = function(e) {
$('html').css('cursor', 'row-resize');
$(window).scrollTop($(window).scrollTop() + (clickY - e.pageY));
}