我有article具有内部 html 的元素,它们是.article-row和.content.
.content被隐藏,.article-row点击时.content会显示。但我希望其他article的,.hide()以便.content当前单击的项目是视图中唯一的项目。
$('.article-row').click(function(e){
e.preventDefault();
if($(this).parent().find('.content').is(':visible')){
$('.content').hide();
}else{
$('.content').hide();
$(this).parent().find('.content').show();
}
});
$('.close').click(function(e){
$(this).parent().hide();
});