使用delegate
或者on
解决问题。
$(".project-details").on('.project-details dl','click',function () {
if($(this).find("dd").css('display') == 'none'){
$(this).addClass("am-active")
$(this).find("dd").css('display','block')
}else{
$(this).removeClass("am-active")
$(this).find("dd").css('display','none')
}
})
网友评论