Suggestion Is there a way to fix PNG image display problems on IE6?

  • Thread starter Thread starter zzzhhh
  • Start date Start date
AI Thread Summary
PNG images with transparent backgrounds do not display correctly in Internet Explorer 6 (IE6), although original PNG images are visible. Users suggest restoring PNGs to their original format or implementing a JavaScript solution to correct the display issue. The discussion acknowledges that IE6 is outdated and unlikely to receive updates, as newer browsers have resolved these problems. The consensus is that IE6's limitations are a recognized issue, and users may need to consider upgrading their browsers for better compatibility. Overall, the discussion highlights the challenges of using outdated technology in a rapidly evolving digital landscape.
zzzhhh
Messages
39
Reaction score
1
I'm still using IE6, which can not display PNG images with transparent background correctly. But the orignal PNG images can be shown correctly, such as those in https://www.physicsforums.com/showthread.php?t=8997. So, I wonder if the forum can restore the PNG format back to the orignal one, or, add the following codes into the <head>...</head> if IE is detected:

<script language="javascript">
function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images
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 = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='image');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG);
</script>


Thanks!
 
Physics news on Phys.org
This is a known problem for IE6. I don't think it will be updated since there are newer browsers which are out there without the problem. Unfortunately, once newer browsers are released older ones tend to get left.
 
Kurdt said:
This is a known problem for IE6.

Correctly put: IE is a known problem :wink:
 
I want to thank those members who interacted with me a couple of years ago in two Optics Forum threads. They were @Drakkith, @hutchphd, @Gleb1964, and @KAHR-Alpha. I had something I wanted the scientific community to know and slipped a new idea in against the rules. Thank you also to @berkeman for suggesting paths to meet with academia. Anyway, I finally got a paper on the same matter as discussed in those forum threads, the fat lens model, got it peer-reviewed, and IJRAP...
About 20 years ago, in my mid-30s (and with a BA in economics and a master's in business), I started taking night classes in physics hoping to eventually earn the science degree I'd always wanted but never pursued. I found physics forums and used it to ask questions I was unable to get answered from my textbooks or class lectures. Unfortunately, work and life got in the way and I never got further the freshman courses. Well, here it is 20 years later. I'm in my mid-50s now, and in a...

Similar threads

Back
Top