After analyzing the most important aspects of the development of jQuery plugins, we are now ready to analyze an implementation that is used for something more than a simple demonstration. In order to create a really useful and reusable plugin, it must be designed such that its operations are not restricted by the demands of its original use case.
The most popular plugins, like the most useful jQuery methods, are those that provide a high degree of configuration of their functionality. Creating a plugin that is configurable adds a degree of flexibility to its implementation, which enables us to match the needs of several other use cases that are governed by the same operation principles.
As we said earlier, a jQuery plugin is just a function attached to the $.fn
object and, as a result, we can make its implementation more abstract and generic in the same way as with plain functions of our modules. As in simple functions, the easiest way to differentiate the operation...