var display = this.currentStyle? this.currentStyle.display: window.getComputedStyle(this, null).display;
老师能不能解释下这句话?
var display = this.style.display不行吗?
这是一个if else 简写
if(this.currentStyle){
this.currentStyle.display
}else{
window.getComputedStyle(this, null).display;
}主要是为了兼容IE
this.style.display不能获取外部CSS样式