Created
February 19, 2015 15:23
-
-
Save zurie/ae13761985eba328dce1 to your computer and use it in GitHub Desktop.
Default Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You need an anonymous function to wrap around your function to avoid conflict | |
(function($){ | |
//Attach this new method to jQuery | |
$.fn.extend({ | |
//This is where you write your plugin's name | |
pluginname: function() { | |
//Iterate over the current set of matched elements | |
return this.each(function() { | |
//code to be inserted here | |
}); | |
} | |
}); | |
//pass jQuery to the function, | |
//So that we will able to use any valid Javascript variable name | |
//to replace "$" SIGN. But, we'll stick to $ (I like dollar sign: ) ) | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment