Skip to content

Instantly share code, notes, and snippets.

@toepoke
Created December 31, 2013 10:47
Show Gist options
  • Save toepoke/8195174 to your computer and use it in GitHub Desktop.
Save toepoke/8195174 to your computer and use it in GitHub Desktop.
jQuery extension methods
/// <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