Setting the IE opacity ;)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am trying to set the opacity of a div, it works with FF and with
Safari but not with IE7:
The page (which has been reduced) is:

Using IE7, we enter inside the "if" of the function:

function change_opa(i) {
  if(document.all) {
    alert("dans if") ;
  } else {
    alert("dans else") ;
    document.getElementById('main-data').style.opacity = 3/10 ;

But IE7 does not do the .style.filter...

Any idea ?


PS: Sorry for the alert('') which takes all the page!

Re: Setting the IE opacity ;)

Defacta wrote:
Quoted text here. Click to load it

Ditch the if(document.all) test and just set it (or test for the
property). I simply do this: = value_/100; = 'alpha(opacity=' + value_ + ')';

where value_ = 0 to 100;


Quoted text here. Click to load it

Site Timeline