I am piggy-backing off of this question, and would like to use this technique within an event handler that looks for a 'has class'.
The goal is to have this in a menu bar with icons/images.
So far, I am not able to find the bug in the following code:
$('.className').click(function(){
$('.className').removeClass('activeDesignation');
$(this).addClass('activeDesignation');
if ( $('.className').hasClass('activeDesignation')){
$(this).attr("src").replace(".png", "[suffix].png");
};
});
The general Syntax appears to be ok, since the following works:
$('.className').click(function(){
$('.className').removeClass('activeDesignation');
$(this).addClass('activeDesignation');
if ( $('.className').hasClass('activeDesignation')){
$(this).hide('slow');
};
});
Just at a loss here