Issue
Is it possible to do something like that:
<ul class="handle" data-option="9000">
$('.handle').pluginName({
option: $('this').data('option'),
});
where $('this') should target the $('.handle') which is being initialized.
Solution
No, it isn't, you can loop through the elements:
$('.handle').each(function() {
var $this = $(this);
$this.pluginName({ option: $this.data('option') });
});
Or if you are the plugin's author read the data-*
attributes in your plugin.
Answered By - Ram
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.