Code Monkey home page Code Monkey logo

Comments (4)

stebun avatar stebun commented on July 18, 2024

I have two elements, parent and child working with tap.

currently Im testing the event object in my parent for event.isTrigger === undefined.

If this property isn't there I know this event is caused directly by the parent tap, if it is there, it means that the child tap event was called and I can ignore this tap on the parent.

I also need to set domEvents: true on the call to the hammer plugin "hammer({domEvents: true})" for the parent (not the child);

I'm not sure how reliable this is cross browser or how it would work with a child within a child, but for my current needs it works.

Still it would be nice if I could use the jquery plugin and use the propagation.js

from propagating-hammerjs.

josdejong avatar josdejong commented on July 18, 2024

It may work if you first load the propagating-hammer.js script, then override the global Hammer instance (like in this example), and last load jquery.hammer.js. Did you try that?

from propagating-hammerjs.

stebun avatar stebun commented on July 18, 2024

Yes this worked, but it's annoying to have to load the plugin afterwards. Can't you do anything to fix this? There must be lots of people using the widget and your propagation.js

from propagating-hammerjs.

josdejong avatar josdejong commented on July 18, 2024

I can think of two options:

  • Create a new module jquery.propagating.hammer.js which combines both.
  • Use vanilla JavaScript instead of jquery.hammer.js. There isn't really much need for jQuery anymore, and JavaScript isn't that scary ;)

from propagating-hammerjs.

Related Issues (11)

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.