gadicc / meteor-famous-views

Famous, the Meteor Way (with Reactive Blaze Templates/Views)
http://famous-views.meteor.com/
GNU Lesser General Public License v3.0
332 stars 27 forks source link

How to make a surface draggable. #262

Open PankajJatav opened 9 years ago

PankajJatav commented 9 years ago

Hi Everyone, I am new to famous, So i don't know, my code is either wrong or right. I just apply logic that if user touchmove them i will set the modifier origin.


I just created a surface {{#Modifier}} {{>Surface template="image" align="[0.5,0.5]" origin="[0.5, 0.5]" size="[200,200]"} {{/Modifier}}


In my js file add a event like this. touchmove':function(evt, tpl){ tpl.modifier.setOrigin( evt.changedTouches[0].clientX/($( window ).width()), evt.changedTouches[0].clientY/$( window ).height() );


thanks in advanced.