zl程序教程

您现在的位置是:首页 >  其它

当前栏目

通用于ie和firefox的函数GetCurrentStyle(obj,prop)

函数 IE 通用 firefox OBJ prop
2023-06-13 09:13:51 时间
functionGetCurrentStyle(obj,prop){
	if(obj.currentStyle){
		returnobj.currentStyle[prop];
	}
	elseif(window.getComputedStyle){
		prop=prop.replace(/([A-Z])/g,"-$1");
		prop=prop.toLowerCase();
		returnwindow.getComputedStyle(obj,"").getPropertyValue(prop);
	}
	returnnull;
}

代码来自于http://tvweek.com/javascripts/default.js