So, the opacity style is rather annoying because every browser seems to handle it differently. I guess it's because opacity wasn't included in the w3c standards to begin with...mind you if it had been included from the get-go, I have my doubts on whether this would have changed anything that we have to deal with today.
Anyways, enough ranting....I'm attempting to place a <div> over top of my content while an asynchronous call to the server is taking place. This is done to prevent the user from submitting any additional data to the server during "special" processes...
I'd like to set the opacity of this <div> to about 50% so that it looks all "pretty" and the user knows that they aren't able to access any of the content in the area behind the <div>.
Some strange stuff is happening in IE7 and 8.
The <div> is appearing over top of the content correctly....bu t the opacity settings are very strange. It starts at about 50% at the middle of the <div> but as it spreads outwards it fades to 0%. It's kind of neat (a half faded circle in the center that fades to nothing)...but it's not what I want.
What am I doing wrong here?
How do I change this so that the entire <div> is faded to 50% instead of just a circle in the middle of my <div>?
[code=javascript]
function Processing() {
//shield is the <div> that is used to cover the content and already has the the position style set to absolute.
var shield = document.getEle mentById('ctl00 _CPH_MainConten t_myControl_shi eld');
shield.style.di splay = 'block';
//I had attempted setting the CSS Class for the div that would have set
//opacity of it, but this isn't working well with the asynchronous stuff in IE
//so I decided to set each individual style in JavaScript instead
//shield.classNam e = 'modalBackgroun d';
shield.style.ba ckgroundColor=' white';
shield.style.fi lter = 'progid:DXImage Transform.Micro soft.Alpha(Opac ity=50, FinishOpacity=0 , Style=2)';
shield.style.op acity='.5';
}[/code]
The following works but I'm don't think it will work in IE6:
Thanks for your time,
-Frinny
Anyways, enough ranting....I'm attempting to place a <div> over top of my content while an asynchronous call to the server is taking place. This is done to prevent the user from submitting any additional data to the server during "special" processes...
I'd like to set the opacity of this <div> to about 50% so that it looks all "pretty" and the user knows that they aren't able to access any of the content in the area behind the <div>.
Some strange stuff is happening in IE7 and 8.
The <div> is appearing over top of the content correctly....bu t the opacity settings are very strange. It starts at about 50% at the middle of the <div> but as it spreads outwards it fades to 0%. It's kind of neat (a half faded circle in the center that fades to nothing)...but it's not what I want.
What am I doing wrong here?
How do I change this so that the entire <div> is faded to 50% instead of just a circle in the middle of my <div>?
[code=javascript]
function Processing() {
//shield is the <div> that is used to cover the content and already has the the position style set to absolute.
var shield = document.getEle mentById('ctl00 _CPH_MainConten t_myControl_shi eld');
shield.style.di splay = 'block';
//I had attempted setting the CSS Class for the div that would have set
//opacity of it, but this isn't working well with the asynchronous stuff in IE
//so I decided to set each individual style in JavaScript instead
//shield.classNam e = 'modalBackgroun d';
shield.style.ba ckgroundColor=' white';
shield.style.fi lter = 'progid:DXImage Transform.Micro soft.Alpha(Opac ity=50, FinishOpacity=0 , Style=2)';
shield.style.op acity='.5';
}[/code]
The following works but I'm don't think it will work in IE6:
Code:
function Processing() {
var shield = document.getElementById('ctl00_CPH_MainContent_myControl_shield');
shield.style.display = 'block';
//shield.className = 'modalBackground';
shield.style.backgroundColor='white';
shield.style.filter = 'alpha(opacity=50)';
shield.style.opacity='.5';
}
-Frinny
Comment