Hi,

I wrote a little equal height plugin.

Now, say I have two pairs of divs on a page, and I want the divs
having the same class to have the same height. My function call would
look something like this:

$('.classOne, .classTwo').equalHeight();

At them moment the plugin looks like this:

(function($) {
        $.fn.equalHeight = function(){
                var highest = '';
                this.each(function() {
                        alert($(this).length);
                        thisHeight = $(this).height();
                        if(thisHeight > highest) {
                                highest = thisHeight;
                        }
                });
                return this.height(highest);
        };
})(jQuery);

Is there a way to work with the matched elements for each selector
inside the plugin (so without calling the plugin for each selector)?
At the moment the plugin simply compares all elements on the page,
thus they all end up having the same height.

Thanks!

Reply via email to