Adding actions to plugins
In this example, let's create a plugin that can perform more than one action by taking in the desired action as an argument. The programming constructs used in this example are summarized as follows:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element based on its ID |
|
jQuery object |
This refers to the current jQuery object |
|
jQuery function |
This merges the contents of two or more objects into the first object |
. |
jQuery method |
This performs a custom animation on the specified CSS properties |
|
jQuery method |
This gets the style property for the first matched element or sets the style property for every matched element |
|
jQuery method |
This iterates over the matched elements and executes a function for each element |
|
JavaScript function |
This executes a function repeatedly after the specified delay in milliseconds |
Getting ready
Follow these steps...