Reputation: 33
Here is the code :
$('.el')
.drag("init", function () {
//
})
.drag("start", function () {
//
})
.drag("end", function () {
//
});
I couldnt find a way to pass the parameters in the case below
$('.el').on({
drag: function(){
//*init* functions
},
drag: function(){
//*start* functions
},
drag: function(){
//*end* functions
}
})
Is it possible to pass parameters while using on
event delegation for multiple events at once. Or the only solution is using on
for multiple times.
Upvotes: 0
Views: 121
Reputation: 318202
You should probably lead with the fact that you're using a plugin, more specifically this plugin.
The docs are pretty clear, there are events built in, such as draginit
, dragend
etc. that can be used instead of the drag()
method
$(document).on({
draginit: function(){
//*init* functions
},
dragstart: function(){
//*start* functions
},
dragend: function(){
//*end* functions
}
}, '.el');
Upvotes: 2