我试图创建一个运行的代码,如果点击li元素没有一个类照片的if语句。检查是否点击的元素没有特定的类
$('div.menu li').click(function(){
var content = $(this).attr('class');
if (/* I can't figure out the correct syntax that goes here? */){
$("div.content_wrapper, div.content").hide();
$('div.content_wrapper').animate({width: 'toggle'});
$('div.content_wrapper, div.' + content).show();
$('div.menu li').removeClass('menuactive');
$(this).addClass('menuactive');
}
});
+1智能答案。 – undefined
有趣,谢谢! – farrkling