Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Created November 8, 2012 00:32
Show Gist options
  • Save seyDoggy/4035641 to your computer and use it in GitHub Desktop.
Save seyDoggy/4035641 to your computer and use it in GitHub Desktop.
Sample jquery plugin used at #KWDM
# plugin code
(function($){
$.fn.myTallest = function(){
var tallest = 0,
thisTallest = 0;
$(this).each(function(){
thisTallest = $(this).height();
if (thisTallest > tallest) tallest = thisTallest;
}).height(tallest);
return $(this);
};
})(jQuery);
# sample usage
$(function(){
$('.three .content').myTallest().css('color','red');
$('.five .content').myTallest();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment