Tôi đang cố gắng tạo câu lệnh if chạy mã nếu phần tử li được nhấp không có lớp ảnh.Kiểm tra xem phần tử đã nhấp không có lớp cụ thể
$('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 câu trả lời thông minh. – undefined
Thú vị, cảm ơn bạn! – farrkling