Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to drag divider on mobile #4

Open
aaemnnosttv opened this issue Sep 16, 2016 · 0 comments
Open

Can't seem to drag divider on mobile #4

aaemnnosttv opened this issue Sep 16, 2016 · 0 comments

Comments

@aaemnnosttv
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant