loop thru divs -- trigger event only when ONE div is shown..

loop thru divs -- trigger event only when ONE div is shown..

hi,
I have this pretty standard code to show and hide divs:

$("#subNav > li > a").click(function(e) {
$("#mainDivs > div").hide();
var divID = this.className;
$("#mainDivs > div#" + divID).show();
return false;

});
$("a.one").click(); // hide all but first div
I need to say: when show div with such-and-such a class (that no other div has) THEN trigger an event, inside that div...  how would I do that, please...

$("#subNav > li > a").click(function(e) {
$("#mainDivs > div").hide();
var divID = this.className;
$("#mainDivs > div#" + divID).show();
//   when showing div with class "x" then do such-and-such...;-)
return false;
});

thank you very much..