ITeye博客

jquery check display block

fancyboy2050 · 2011-11-10 12:00 · js · 互联网 · js jquery · Markdown


$(this).closest(".list_head").next(".list_con").toggle();
toggle():切换元素可见状态
if($(this).closest(".list_head").next(".list_con").is(':visible')){
    $(this).closest(".list").addClass("list_now");
} else {
    $(this).closest(".list").removeClass("list_now")
}
.is(':visible'):检测元素是否可见

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。