Published in: JavaScript
URL: http://bmky.net/text/note/javascript-css.html
function getActiveStyle( element, property, pseudo ) { if( element.currentStyle ) { //IE or Opera if( property.indexOf( "-" ) != -1 ) property = property.camelize( ); return element.currentStyle[ property ]; } else if( getComputedStyle ) { //Mozilla or Opera if( property.indexOf( "-" ) == -1 ) property = property.deCamelize( ); return getComputedStyle( element, pseudo ).getPropertyValue( property ); } return ""; }
You need to login to post a comment.
