2015-05-25 37 views
2

如何調用刷卡事件?我想通過滑動觸發事件。下面的代碼在正常的查詢事件中工作正常。不知道如何在流星事件中實現。關於在流星中刷卡事件

$('.your-class').on('swipe', function(event, slick, direction){ 
    console.log(direction); 
    }); 

流星:

Template.template.events({ 
'???? .your-class':function(event, slick, direction){ 
    console.log(event); 
    } 
}); 

回答

0

嘗試hammer:hammer包。

Events

Template.NAME.events({ 
'swipeleft #hammerDiv': function(e, t) { 
    e.preventDefault(); 

    // event 
    }, 
'swiperight #hammerDiv': function(e, t) { 
    e.preventDefault(); 

    // event 
    } 
});