Please correct me if I am wrong!
https://codepen.io/MrHill/pen/kLvcw
The above url shows functional combination number lock using jQuery draggable. I want to use this in touch devices (touchmove event in js). I try to google it but I found following code
jQuery(".lock-dial ul").draggable();
jQuery.fn.draggable = function() {
var offset = null;
var start = function(e) {
var orig = e.originalEvent;
var pos = jQuery(this).position();
offset = {
y: orig.changedTouches[0].pageY - pos.top
};
};
var moveMe = function(e) {
e.preventDefault();
var orig = e.originalEvent;
jQuery(this).css({
top: orig.changedTouches[0].pageY - offset.y,
});
};
this.bind("touchstart", start);
this.bind("touchmove", moveMe);
};
In the above code touchmove is working. but not properly. while dragging in touch devices repeatable numbers are not working and y axis scrolling position not equal with jQuery draggable (scrolling in draggable function y axis increment/decrement by 35px).
I think I didn't explain correctly. Actually https://codepen.io/MrHill/pen/kLvcw combination number lock functionality work with touch devices.
This code is needed for my brother college mini project in login module. Could anyone please help me? Thanks in advance.