How to get the selector used to initialise a plugin within the plugin?
My first idea was to use $(this).attr('class');
but that would retrieve all classes set.
edit
$('.thisSelector').pluginName();
How can I retrieve this select开发者_如何转开发or within the plugin?
$(this).selector
see api docs
Actually, within a plugin, there is no need to wrap "this" in a jQuery function, so it's just
this.selector
Sorry I don't have enough reputation to add this as a comment.
精彩评论