Setup:
I have a website that is hosted locally on a Desktop Computer, I have a touchscreen hooked up to that Desktop. The website is viewed on the touchscreen using Firefox.
Requirements:
Questions:
Thanks very much.
Point the touch-device in question to this demo url : http://lab.cubiq.org/iscroll/examples/simple/
-Via the iScroll 4 docs
Ill let you work out the nuances, but something like this gives you an idea
$(function(){
var dragYStart;
var dragScrollStart;
$(window).one('mousedown',startDrag);
function startDrag(e){
dragYStart = e.pageY;
dragScrollStart = $(window).scrollTop();
$(window).on('mousemove',drag);
$(window).one('mouseup',stopDrag);
}
function stopDrag(e){
$(window).off('mousemove',drag);
$(window).one('mousedown',startDrag);
}
function drag(e){
var delta = dragYStart - e.pageY;
$(window).scrollTop(dragScrollStart + delta);
}
});
UPDATE... found this this morning. this is probably exactly what you want
use "mine" js plugin I also have swipe event handler :D http://hoangminhdat.com/myLab/dragScrollJS/
It doesn't work on handheld device, but work great on desktop, it's also very simple
I made it :D
©2020 All rights reserved.