Home > Web Front-end > JS Tutorial > Function GetCurrentStyle (obj, prop)_javascript skills common to IE and Firefox

Function GetCurrentStyle (obj, prop)_javascript skills common to IE and Firefox

WBOY
Release: 2016-05-16 19:22:09
Original
1022 people have browsed it
function GetCurrentStyle (obj, prop) {
	if (obj.currentStyle) {
		return obj.currentStyle[prop];
	}
	else if (window.getComputedStyle) {
		prop = prop.replace (/([A-Z])/g, "-$1");
		prop = prop.toLowerCase ();
		return window.getComputedStyle (obj, "").getPropertyValue(prop);
	}
	return null;
}
Copy after login

代码来自于http://tvweek.com/javascripts/default.js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template