使用:visible。只要在选择器后面加上:visible,然后检查选择结果是否为空即可。例如: if($('#mydiv:visible').length > 0) 转载于:https://www.cnblogs.com/sungang3225/p/3834973.html