Created
December 31, 2013 10:47
-
-
Save toepoke/8195174 to your computer and use it in GitHub Desktop.
jQuery extension methods
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
/// <summary> | |
/// showey - noddy example of how to add an extension method to jQuery | |
/// <summary> | |
jQuery.fn.showey = function() { | |
for (var i=0; i < this.length; i++) { | |
var $ele = $(this[i]); | |
$ele.show("fast", "linear"); | |
} | |
// maintain chainability | |
return this; | |
}; | |
// | |
// Example usage: | |
// $(".some-class") | |
// .showey() | |
// .css("border", "solid 1px blue") | |
// ; | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment