这对于你在Stackoverflow中的jQuery大师来说很简单.
我有以下jQuery函数,我想知道是否有一种方法来优化代码:
$('.dropdown li').click(function(){ $(this).siblings().find('.active').removeClass('active') $(this).siblings().find('ul:visible').slideUp(); $(this).toggleClass('hover'); $('ul:first',this).slidetoggle(); $('.arrow-down',this).toggleClass('active'); });
——–
快速提问:
(‘.selector“this”和(‘.selector’,这个)有什么区别?我希望我输入这个权利.
你可以看到我对jQ很新,所以即使我在问愚蠢的问题,我也需要所有的帮助^ _ ^
提前致谢.