2016-04-21 37 views
-2

由于我不想进入的原因。我想实现这个菜单的效果:在不使用Modernizr的情况下实现这个结果?

演示: http://tympanus.net/codrops/2013/04/19/responsive-multi-level-menu/

但是,如果没有使用Modernizr的到位可能使用JQuery。在这部分代码是什么绊倒了我,让

$.DLMenu.prototype = { 
    _init : function(options) { 
// options 
     this.options = $.extend(true, {}, $.DLMenu.defaults, options); 
     // cache some elements and initialize some variables 
     this._config(); 

     var animEndEventNames = { 
       'WebkitAnimation' : 'webkitAnimationEnd', 
       'OAnimation' : 'oAnimationEnd', 
       'msAnimation' : 'MSAnimationEnd', 
       'animation' : 'animationend' 
      }, 
      transEndEventNames = { 
       'WebkitTransition' : 'webkitTransitionEnd', 
       'MozTransition' : 'transitionend', 
       'OTransition' : 'oTransitionEnd', 
       'msTransition' : 'MSTransitionEnd', 
       'transition' : 'transitionend' 
      }; 
     // animation end event name 
     this.animEndEventName = animEndEventNames[ Modernizr.prefixed('animation') ] + '.dlmenu'; 
     // transition end event name 
     this.transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ] + '.dlmenu'; 
     // support for css animations and css transitions 
     this.supportAnimations = Modernizr.cssanimations; 
     this.supportTransitions = Modernizr.csstransitions; 

     this._initEvents(); 

    }, 

Codepen的一切 - http://codepen.io/eclipsewebdesign/pen/FcuGJ/

这甚至可能吗?任何帮助将不胜感激我尝试使用JQuery,但与我有限的知识,我没有成功。

谢谢

+0

为什么不在您的构建中包含Modernizr?您可以输出一个自定义版本,其中只包含您要使用的插件所需的CSS动画/转换测试。 –

回答

0
$('.top-menu').click(function() { 
    $(this).fadeIn('fast', function() { 
     if($(this).next().length > 0) { 
      $(this).fadeOut('fast', function() { 
       $(this).next().fadeIn('fast'); 
     }); 
     } 
    }); 
}); 

像这样的事情?

相关问题