Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call plugin w/o an element #104

Closed
thedamon opened this issue Apr 6, 2015 · 2 comments
Closed

How to call plugin w/o an element #104

thedamon opened this issue Apr 6, 2015 · 2 comments

Comments

@thedamon
Copy link

thedamon commented Apr 6, 2015

I'm trying to create a plugin that can be called without an element.

I understand I should use $.extend to do that, but I don't see how to do it with the boilerplate as written.. it's already using extend but my plugin isn't available as a $.myPluginName() and I don't quite follow where I need to change to make sure it's extending the default $ object

@vovan47
Copy link

vovan47 commented Aug 27, 2015

I have the same problem. Did you handled it?

@heldr
Copy link
Member

heldr commented Sep 5, 2015

This is not a pattern though

//...
function Plugin ( options ) {
  //...
}
//...
// do not use $.fn
$[ pluginName ] = function ( options ) {
  return new Plugin( options );
};

@heldr heldr closed this as completed Sep 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants