Posted By

noah on 06/11/07


Tagged

css ie crossbrowser opacity DOM web20 standards dhtml chrome transition effect transparent portable


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

luman
joseluis
vali29


Change opacity in all browsers


 / Published in: JavaScript
 

URL: http://www.gtalbot.org/DHTMLSection/DynamicOpacity.html

Check whether style.opacity is available. If not, then apply IE proprietary opacity

  1. fadeDown: function (id) {
  2. var objToFade = document.getElementById(id);
  3. if(typeof objToFade.style.opacity == "string") {
  4. objToFade.style.opacity = 0.5;
  5. } else {
  6. //here use document.getElementById(id).filters.alpha.opacity
  7. }
  8. },

Report this snippet  

You need to login to post a comment.