最近碰到一个需求,因为在IE8下,左侧2级导航因为滚动条挡住3级菜单,导致不能选中

思索了下,参考QQ的头像简介功能写了个延迟操作,解决了这个问题

二级菜单延迟隐藏

 

    var timer = null;
    $(".xj-third-li").hover(function(){
        clearTimeout(timer);
        $(this).find(".xj-third-nav").show();
        $(this).addClass("xj-third-li-hover");
    },function(){
         var self = $(this);
         timer = setTimeout(function() {
             if(self.find(".xj-third-nav").css('display')!='none'){
                 self.find(".xj-third-nav").hide();
                 self.removeClass("xj-third-li-hover");
             }
            }, 500);
        
        });

 

相关文章:

  • 2021-11-01
  • 2022-12-23
  • 2021-05-21
  • 2022-02-08
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-10-20
  • 2021-12-26
  • 2021-08-07
相关资源
相似解决方案