Reputation: 13
Using this SimpleDropDownEffects plugin for jQuery, when the selected value is changed, how do I add a callback?
I'm looking for something on the lines of 'onChange'.
$.DropDown.defaults = {
onChange: false,
}
ok, what next? plug-in have a function of the click to the option:
this.opts.on( 'click.dropdown', function() {
// Not executed.
}
Upvotes: 1
Views: 930
Reputation: 1252
You can do it with
$('#cd-dropdown').dropdown({
gutter: 5,
onOptionSelect: function(dom) {
var value = $(dom).attr("data-value")
console.log(dom, value);
}
});
as you can see every change it logs created element from select and values of it.
Upvotes: 1