javascript - Fire different events on multiple elements with Hammer.js -
I try three days to do simple drag events on two different pictures at the same time. Searched but I get old examples that are not working today.
I have been successful in dragging all the pictures and implementing pinch of events, but when I try to select two different photographs, Hummer JS thinks that I first chose I want to pin the picture.
I hammer js How can I say that I want different events on many elements?
EDIT: New code, what is your opinion?
So, I've changed a lot of things, I think that ^^ now app correctly. JS looks like this:
/ * Now look at the main container, and wait something with the element / function pictureMod (container, element) {Var Container = document.getElementById (Container) ; Var Hermarium = new hammer (container, {drag_max_touch: 0, stop_default: true, level_rrossed: 0,}); Hammertime.on ("drag dragend transform", function (ev) {var touchs = ev.gesture.touches; ev.gesture.preventDefault (); var posX = 0, posY = 0, width = 0; (var t = 0, lane = touch.lambi; t
and index.html:
& lt; Div id = "container" & gt; & Lt; Img src = "img / pic1.jpg" alt = "" width = "350" height = "200" square = "polaroid" /> & Lt; Img src = "img / pic2.jpg" alt = "" width = "200" height = "200" square = "polaroid" /> & Lt; Img src = "img / pic3.jpg" alt = "" width = "250" height = "300" square = "polaroid" /> & Lt; / Div & gt; & Lt; Script src = "js / app.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; New PictureMod ("Container", "Polaride"); & Lt; / Script & gt;
Now I can manipulate my various elements better than before, but I still can not pull two different elements at the same time!
Can anyone help?
I tried to use your code quickly to use your position, but the photos Are not dragable Are you leaving some compulsory code that you have used or information? I will try to resolve this issue because no one has ever jumped in it. Just give me more code for me to work, as the code given is not working.
Comments
Post a Comment