Is this possible? I want an event开发者_如何学JAVA to fire when this happens.
Hmm, why do you need this? Instead, I would suggest thinking about what causes the element to be shown/hidden and react to that. It's always better to decouple your logic from view.
But if you still really want to do this, the only way I can think of right now is to have an interval that keeps polling for the element's visibility.
you could use livequery to do this.
$('div.myClass:hidden').livequery(function(){
//do something when hidden
});
$('div.myClass:visible').livequery(function(){
//do something when visible
});
精彩评论