Jump to content

Recommended Posts

Posted

Hi guys,

 

Today I made all the logos for the new site, i viewed them in fire fox the logos look perfect. But tonight I went back into it with IE7 and you can see the background, if you get me.

 

I have attached some screenshots to show what i mean. I can't use transparent backgrounds with PNG format as they don't render in IE6 and show a grey background.

 

How do I fix this please?

 

Z

Posted
erm... try the suggestion above your post Scotmk - that'll fix it

 

8O

 

I know, sorry, did'nt mean to sound like I did'nt read the post properly.

Posted

You could use javascript to get the transparency in IE6 if you wanted:

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])
  if ((version >= 5.5) && (document.body.filters)) 
  {
     for(var i=0; i      {
        var img = document.images[i]
        var imgName = img.src.toUpperCase()
        if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
        {
           var imgID = (img.id) ? "id='" + img.id + "' " : ""
           var imgClass = (img.className) ? "class='" + img.className + "' " : ""
           var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
           var imgStyle = "display:inline-block;" + img.style.cssText 
           if (img.align == "left") imgStyle = "float:left;" + imgStyle
           if (img.align == "right") imgStyle = "float:right;" + imgStyle
           if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
           var strNewHTML = "            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
           + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
           + "(src=\'" + img.src + "\', sizingMethod='scale');\">" 
           img.outerHTML = strNewHTML
           i = i-1
        }
     }
  }    
}
window.attachEvent("onload", correctPNG);

 

Save that as "iepngfix.js" and then reference it in your pages with

  • Thanks 1
Posted
erm... try the suggestion above your post Scotmk - that'll fix it

 

8O

 

I know, sorry, did'nt mean to sound like I did'nt read the post properly.

 

np - sorry - tough 5 minutes here ;)

 

Blimey you put in a lot of work makng all those colour variations! :)

 

 

@ mrcrazy04: That's a cure for alpha transparencies in IE - this is a different problem I believe

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...