Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my code is working perfectly on firefox but not on IExplorer 6 some part of my code is:

JavaScript
document.getElementById('layout').style.opacity = .7
document.getElementById('layout').style.display = "block"
Posted
Updated 20-May-14 12:17pm
v2
Comments
Nelek 20-May-14 18:18pm    
And you think that "it doesn't work" is enough?

need to get browser at first by writing javascript code

var browser=navigator.appName //get Browser name

and then set the opacity for different browsers

if(browser=="Netscape") //For mozilla firefox
{
document.getElementById('layout').style.opacity = .7;
}

if(browser=="Microsoft Internet Explorer")
{
document.getElementById('layout').style.filter:alpha(opacity=70); /* IE 5-7 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
}

You can visit my blog for more reference http://cshotopics.blogspot.in/2014/02/interactive-form-design-using-css-jquery.html[^]
 
Share this answer
 
v2
The solution is very short => Upgrade your IE.
 
Share this answer
 
try below
JavaScript
document.getElementById("layout").className = "transparent_class";

with css
CSS
.transparent_class {
  /* IE 8 */
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";

  /* IE 5-7 */
  filter: alpha(opacity=70);

  /* Netscape */
  -moz-opacity: 0.7;

  /* Safari 1.x */
  -khtml-opacity: 0.7;

  /* Good browsers */
  opacity: 0.7;
}


ref http://css-tricks.com/snippets/css/cross-browser-opacity/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900