开发者

When hover too fast between elements, double elements show

开发者 https://www.devze.com 2023-04-09 03:28 出处:网络
When I hover between elements very quickly, two or more elements will show. If move slowly, it works perfect. Here\'s the code:

When I hover between elements very quickly, two or more elements will show. If move slowly, it works perfect. Here's the code:

$("#services_menu a").hover(function(e) {
  var id = this.hash;
    $("#services_description div:visible").not(id).fadeOut('fast', function(){
    $(id).fadeIn();
  });
  e.preventDefault();
});
$("#services_descr开发者_JAVA技巧iption div:not(#agency_leasing)").hide();

How do I fix this? Thanks.


Just put

.stop(true,true)
before fadeOut and fadeIn

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号