Posted By

szsk on 08/24/06


Tagged

css javascript ie DOM Opera Firefox


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

shachi
vali29


getActiveStyle


 / Published in: JavaScript
 

URL: http://bmky.net/text/note/javascript-css.html

  1. function getActiveStyle( element, property, pseudo ) {
  2. if( element.currentStyle ) { //IE or Opera
  3. if( property.indexOf( "-" ) != -1 ) property = property.camelize( );
  4. return element.currentStyle[ property ];
  5. }
  6. else if( getComputedStyle ) { //Mozilla or Opera
  7. if( property.indexOf( "-" ) == -1 ) property = property.deCamelize( );
  8. return getComputedStyle( element, pseudo ).getPropertyValue( property );
  9. }
  10. return "";
  11. }

Report this snippet  

You need to login to post a comment.