I've strong knowledge in jQuery but not in JavaScript (skill level like jQuery). And I want to learn writing a plugin and so I've visited a lot of websites for the tutorials and the great start is Creating a basic plugin to Advanced plugin concepts which gave me a great idea to write the plugins.
So, now I wanted to directly write my plugin using a boilerplate. But I'm stucked with some concepts that I couldn't find anywhere in the wild.
- init: Why initialization method is used? And what kind of code should I write here?
- plugin method: Should I write my whole code in
$.fn[ pluginName ] = function ( options ) {or infunction Plugin ( element, options ) {constructor?
An example with very basic plugin extending the boilerplate would be helpful to me if you can provide me.
Aucun commentaire:
Enregistrer un commentaire