this question has answer here:
i want capture double click event in backbone view
var homepage = backbone.view.extend({ initialize: function(){ this.render(); }, render: function(){ var template = _.template($('#app1').html()); this.$el.html(template); }, events: { 'click #btn1': function(){ alert('single click'); }, 'dblclick #btn1': function(){ alert('double click'); } } }); var view1 = new homepage({ el: '#container' });
double click not work in backbone. how capture it?
similar
$('#btn1').on('dblclick', function(){ alert('double click'); });
the issue here alert
firing after single click , halting execution. changing alert
s console.log
s show both events firing expected:
events: { 'click #btn1': function() { console.log('single click'); }, 'dblclick #btn1': function() { console.log('double click'); } }
you run issue of both single , double clicks firing. discussed further here: backbone.js - both click , double click event getting fired on element