I have come across plenty of jQuery Plugin Patters (boilerplates) on this website:
Nonetheless I was looking even further but I was unable to find anything that would work as I expected. My knowledge for jQuery is quite low, yet I thought I will earn the best if I start creating some small plugins for self... Just for fun and to learn more.
So for example I like this patter: Best Options Pattern
It looks clean and quite nice to me. However I am not sure why I cannot call the plugin like all other plugins that we can find around... For example backstretch JS or Make it Retina... It is called like this.
$.backstretch('path to image');
$.makeItRetina();
So I have tried everything that I thought it might work and the only way to call the plugin from that pattern above is following:
$(document).pluginName();
And I don't want to have it like that... It looks better and simplified if it's just
$.pluginName();
Anyone to show me the path / way how to do this ? I am really confused.
$library functions that invoke jQuery themselves. Nevertheless, you're right on the long term,$will probably reach critical mass a few years from now. Then we can introduce$._(or the other way around) and start over.