I'm having trouble getting the divider to move on mobile using the jquery build.
I thought this might have something to do with the bindings missing for the touch events, so I tried adding these (in the equivalent place in the dist file):
diff --git a/src/js/jquery.twentytwenty.js b/src/js/jquery.twentytwenty.js
index d481877..c7bb2d5 100644
--- a/src/js/jquery.twentytwenty.js
+++ b/src/js/jquery.twentytwenty.js
@@ -61,17 +61,17 @@ var TT = require('./core.js');
};
container
- .on('mousedown', function(e) {
+ .on('mousedown touchstart', function(e) {
isActive = true;
container.addClass('active');
adjustContainerOnSwipe(e);
})
- .on('mousemove', function(e) {
+ .on('mousemove touchmove', function(e) {
if (isActive) {
adjustContainerOnSwipe(e);
}
})
- .on('mouseup', function(e) {
+ .on('mouseup touchend', function(e) {
adjustContainerOnSwipe(e);
container.removeClass('active');
isActive = false;
However that didn't seem to change anything.
The divider can be moved by just tapping on the location you want it to jump to, but that kind of kills the effect.
I'm having trouble getting the divider to move on mobile using the jquery build.
I thought this might have something to do with the bindings missing for the touch events, so I tried adding these (in the equivalent place in the dist file):
However that didn't seem to change anything.
The divider can be moved by just tapping on the location you want it to jump to, but that kind of kills the effect.