日期:2014-05-16 浏览次数:20410 次
var isRuning=false;
$("p.cp").mouseover(function() {
  //增加一个判断
  if(isRuning){
     divHover.stop();
     return;
  }
  divHover.show();
  divHover.offset({
  top: $(this).offset().top,
  left: $(this).offset().left + $(this).width()
  });
});
$("p.cp").mouseout(function(e) {
     isRuning=true;//标记正在隐藏
     e = e || window.event;
     to = e.toElement || e.relatedTarget;
     if (e == divHover) {
       return false;
     }
     divHover.hide(1000,function(){isRuning=false;});//隐藏完毕后,改变变量
     //$(this).removeClass("selected");
});