js判断当前元素是否display隐藏显示
原生js写法
// 判断是否为隐藏(css)样式 function isHide(obj) { var ret = obj.style.display === "none" || obj.style.display === "" || (obj.currentStyle && obj.currentStyle === "none") || (window.getComputedStyle && window.getComputedStyle(obj, null).display === "none") return ret; }
jquery判断方法
if($(this).css("display")=="none"){ //隐藏的 }else{ //显示的 }
本文来源:功夫码(gongfuma.com)
声明:本文系功夫码原创稿件,版权属[功夫码 gongfuma.com]所有。
未经授权不得转载,已经协议授权的媒体下载使用时须注明"稿件来源:功夫码",违者将依法追究责任。