判断如果显示或不显示代码如: if($('#div').is(':hidden')){ //如果隐藏时。。。 }else{ //如果显示时。。。 } 转载于:https://www.cnblogs.com/chuanqimessi/p/4961736.html