jQuery Plugins Introduction
You can download jQuery plug-in from https://jquery.com/plugins
- Create a method.
jQuery.fn.methodName = methodDefinition;
- To Obtain a perfect or compatible code use this .each which is used to perform over a set of matched elements.
- Prefix should conclude with .js.
<>pNote: Where .methodname is the name of a method and
methoddefinition defines a method
Example: Here is a plug-in example.
- Step 1: Install Browsersync using npm. We will use Browsersync to start a server and provide a URL to view the HTML site and to load jQuery using CDN (Content Delivery Network). We will install Browsersync globally.
npm install -g browser-sync
- Step 2: We will be using jQuery-UI plugin for this tutorial. We will test whether this plugin is successfully loaded or not using jQuery. Download the latest version of this plugin and extract it to your project root folder.
- Step 3: Create a index.html file