(function($){ $.fn.accordion = function(opts){ //默认值 var defaults = { max: "30%", min: "10%", speed: "300" } var opts = $.extend(defaults, opts); this.each(function(){ var t = $(this), m = t.children(), c = m.children(); //触发事件 /*m.find(".active a").hide();*/ m.on("mouseenter","li",function(){ $(this).addclass('active') .animate({width:opts.max},opts.speed) .find("a").fadein() .parent().siblings().removeclass('active') .animate({width:opts.min},opts.speed) .find("a").show(); /* $(this).siblings("li").stop(false,true);*/ /*.stop(false,true)*/ }); /* $(this).children().hover(function(){ $(this).addclass('active') .animate({width:opts.max},opts.speed) .find("a").fadein() .parent().siblings().removeclass('active') .animate({width:opts.min},opts.speed) .find("a").show(); })*/ }) } })(jquery);