Hi,

I'm trying to override some of the basic functions of jQuery. My code
is based on this article: http://www.bennadel.com/index.cfm?dax=blog:1624.view

What I want is to fx. hide some extra fields when a given type of
field is hidden. If you for example tries to hide #bar and #bar has a
css class of type "foo" then it should also hide #bar_img.

(function() {
    var originalHide = jQuery.fn.hide;
    jQuery.fn.hide = function() {
        this.each(function() {
            if (this.className == 'foo')
                originalHide.apply( jQuery('#' + this.id + "_img") );
                originalHide.apply(this, arguments);
        });
        return this;
    };
})();

Any help is highly appreciated

Thanks!
//Casper

Reply via email to