2010-04-23 3 views
1

슈퍼 피쉬 메뉴 플러그인의 jquery 코드입니다 (일부 개정 된 후). 서브 우퍼가 으로 움직이게하는 효과를 (superfish 또는 adientitly를 통해) 추가하려는 경우 mouseout에서을 슬라이드합니다 (메뉴 상단에 마우스를 가져갈 때 슬라이드하는 것처럼).Jquery Superfish 메뉴 - 슬라이드하는 방법?

jQuery("ul.sf-menu").supersubs({ 
     minWidth: 12,        // minimum width of sub-menus in em units 
     maxWidth: 27,        // maximum width of sub-menus in em units 
     extraWidth: 1         // extra width can ensure lines don't sometimes turn over 
                 // due to slight rounding differences and font-family 
    }).superfish({ 
     delay:  700,        // delay on mouseout 
     animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation 
     speed:  'fast',       // faster animation speed 
     autoArrows: true,        // disable generation of arrow mark-up 
     dropShadows: false        // disable drop shadows 
    }); 

답변

2

현재로서는 사용할 수 없습니다. 코드 직선 :

show 함수는 animate()를 호출하는 반면 hide 함수는 hide()를 호출합니다.

0

그러나 코드를 해킹하여 사용할 수 있습니다. 패치를 제출 하겠지만 코드 개발은 공개적으로 진행되지 않습니다.

hideSuperfishUl : function(){ 
      var o = sf.op, 
       not = (o.retainPath===true) ? o.$path : ''; 
      o.retainPath = false; 
      var $ul = $(['li.',o.hoverClass].join(''),this) 
       .add(this) 
       .not(not) 
       // .removeClass(o.hoverClass) 
       .find('>ul').animate({opacity: 'hide', height: 'hide'}, o.speed, function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 
      o.onHide.call($ul); 
      return this; 
     }, 
-1

올바른 방법을 보여주는으로 superfish 같은 숨기는 작업을 달성하기 위해 :

hideSuperfishUl : function(){ 
     var o = sf.op, 
     not = (o.retainPath===true) ? o.$path : ''; 
     o.retainPath = false; 
     //hacked code by Farhan Wazir (Seejee) 
    var $ul_p1 = $(['li.',o.hoverClass].join(''),this).add(this).not(not); 
    var $ul_p2 = $ul_p1.find('>ul'); 
    var $ul = $ul_p2.animate({opacity: 'hide', height: 'hide'}, o.speed, 
     function(){ return $ul_p1.removeClass(o.hoverClass).find('>ul').css({top: '-99999em'}).addClass('sf-hidden');}); 
     o.onHide.call($ul); 
     return this; 
}, 
1

내가 superfish의 이전 버전에 대한 확실하지 않다하지만 지금은 쉽게 이루어진다 (slidedown, 그리고 slideup) - 너무 좋아

$('...').superfish({ 
    hoverClass: 'sfhover',   // the class applied to hovered list items 
    animation:  {height: "show", marginTop: "show", marginBottom: "show", paddingTop: "show", paddingBottom: "show"}, // an object equivalent to first parameter of jQuery’s .animate() method. Used to animate the submenu open 
    animationOut: {height: "hide", marginTop: "hide", marginBottom: "hide", paddingTop: "hide", paddingBottom: "hide"}, // an object equivalent to first parameter of jQuery’s .animate() method Used to animate the submenu closed 
}); 
관련 문제