0

我尝试修改 superfish.js - 基于 JQuery 的超级鱼菜单。我有这个功能,工作很棒

   showSuperfishUl : function(){
            var o = sf.op,
            sh = sf.c.shadowClass+'-off',
            $ul = this.addClass(o.hoverClass)
            .find('>ul:hidden').css('visibility','visible');
            sf.IE7fix.call($ul);
            o.onBeforeShow.call($ul);

            $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul);  
            o.onShow.call($ul); });
            return this;
    }

但是如果添加重复

showSuperfishUl1 : function(){
    var o = sf.op,
    sh = sf.c.shadowClass+'-off',
    $ul = this.addClass(o.hoverClass)
    .find('>div:hidden').css('visibility','visible');
    sf.IE7fix.call($ul);
    o.onBeforeShow.call($ul);

    $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); 
    o.onShow.call($ul); });
    return this;
}

功能被破坏了我应该如何组合这些功能?

4

1 回答 1

1

你需要让它双向工作,

  showSuperfishUl : function(){
        var o = sf.op,
        sh = sf.c.shadowClass+'-off',
        $ul = his.addClass(o.hoverClass).find('>*:hidden').css('visibility','visible');
        sf.IE7fix.call($ul);
        o.onBeforeShow.call($ul);

        $ul.animate(o.animation,o.speed,function(){ 
           sf.IE7fix.call($ul);
           o.onShow.call($ul); 
        });
        return this;
  }

但是超级鱼被设计为使用<ul>s和<li>s。t 可能不起作用。

于 2012-10-23T22:05:15.040 回答