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

Fix for vertical touch detection #28

Open
Kingarus opened this issue Oct 30, 2014 · 1 comment
Open

Fix for vertical touch detection #28

Kingarus opened this issue Oct 30, 2014 · 1 comment

Comments

@Kingarus
Copy link

i'm a litte clumsy with git, so i put the code here

more on less on line 206

            var touchMoveSlideLastY 
            if (base.config.touchNav) {
                $container.on("touchstart", function (e) {
                    var eventData = e.originalEvent.touches[0];
                    touchMoveSlideLastY = eventData.clientY;
                    e.preventDefault();
                    base._onMoveStart(eventData.pageX, eventData.pageY);
                    base.actionClick.x=base.currClick.x=eventData.pageX;
                    base.actionClick.y=base.currClick.y=eventData.pageY;
                    base.actionClick.action=true;
                    return e.stopPropagation();
                });
                $container.on("touchmove", function (e) {
                    var eventData = e.originalEvent.touches[0];
                    var currentY = eventData.clientY;
                    if ((currentY < touchMoveSlideLastY - 10) || (currentY > touchMoveSlideLastY + 10)){
                        // moved vertically
                        window.scrollBy(0,touchMoveSlideLastY - currentY); 
                        return;
                    }
                    touchMoveSlideLastY = currentY;
                    e.preventDefault();
                    base.actionClick.action=false;
                    base._onMove(eventData.pageX, eventData.pageY);
                    base.currClick.x=eventData.pageX;
                    base.currClick.y=eventData.pageY;
                    return e.stopPropagation();
                });
@padisio
Copy link

padisio commented Nov 17, 2015

I don't know where I need to add this code. Can you explain it? thanks

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

2 participants