js判断display隐藏显示

// 判断是否为隐藏(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;

 

}

转载于:https://www.cnblogs.com/helkbore/p/6189012.html

你可能感兴趣的:(javascript)