GithubHelp home page GithubHelp logo

Comments (6)

benmajor avatar benmajor commented on August 17, 2024

The callback function has nothing to do with how the library functions? Don't forget that these are simply events, whatever you put in the callback is your responsibility!

from jquery-touch-events.

ctwist avatar ctwist commented on August 17, 2024

OK I will handle it. It just seemed to me that the swipeleft and swiperight functions somehow are incorrectly sharing a setting.

from jquery-touch-events.

benmajor avatar benmajor commented on August 17, 2024

Could you put together a jsFiddle so that I can check?

from jquery-touch-events.

ctwist avatar ctwist commented on August 17, 2024

I couldn't get jsFiddle to do anything useful; it silently discards any external resource that I attach.
I have a workaround; if I ensure that I don't process a null element, everything works correctly.
I won't spend any more time on this.

from jquery-touch-events.

ctwist avatar ctwist commented on August 17, 2024

I have a solution for this.

I found that for the example that I described, touchMove is called twice, the first time with the correct starting coordinates, and the second time with (0,0). The second call thinks that swiping has started, and that it started at (0,0), so it triggers swipedown incorrectly.

I switched the final 2 statements, i.e.
started = false;
$this.trigger('swipe').trigger(swipedir);

This eliminated the second call of touchMove, and the behaviour is now correct.

from jquery-touch-events.

benmajor avatar benmajor commented on August 17, 2024

Thank yo for your assistance, I have now updated the code and everything should be fine.

from jquery-touch-events.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.