Is it function in jQuery? Pseudo code:
$('.smth').bind('mouseout', function(){
if(开发者_运维知识库$('.certain_class').magic_function()) {
$('.fading_object_class').fadeOut("fast");
}
});
If mouse pointer is not on the class certain_class
, it would fade.
P.S. It's for my tooltip plugin.
Here's some pseudo-code. But the main point here is that you can use hasClass if the element that the mouse pointer left has a certain class:
$('.smth').bind('mouseout', function(){
if($(this).hasClass('certain_class')) {
$('.fading_object_class').fadeOut("fast");
}
});
Or if something else has a certain class:
$('.smth').bind('mouseout', function(){
if($('#something_else').hasClass('certain_class')) {
$('.fading_object_class').fadeOut("fast");
}
});
精彩评论