开发者

Get selector used to init plugin within plugin

开发者 https://www.devze.com 2023-03-07 01:22 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消