GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Anyone recommend an ie6 png code? (https://gfy.com/showthread.php?t=911364)

MetaMan 06-18-2009 05:37 PM

Anyone recommend an ie6 png code?
 
obviously pngs dont show in ie6 anyone recommend their fav code to fix it?

harvey 06-18-2009 06:21 PM

I posted it yesterday, here i goes again

Code:

<!--[if lt IE 7]>
<script language="JavaScript">
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<document.images.length; 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 = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i-1
        }
      }
  }   
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->

you can also use SuperSleight but on certain configs it doesn't work, it behaves the same as helix's pngfix. SuperSleight also has a JQuery version

MetaMan 06-18-2009 06:39 PM

Quote:

Originally Posted by harvey (Post 15976075)
I posted it yesterday, here i goes again

Code:

<!--[if lt IE 7]>
<script language="JavaScript">
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<document.images.length; 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 = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i-1
        }
      }
  }   
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->

you can also use SuperSleight but on certain configs it doesn't work, it behaves the same as helix's pngfix. SuperSleight also has a JQuery version


thanks harvey i was reading up on SuperSleight helps me out knowing someone is already successfully using it. your response it much appreciate and makes my decision alot easier. :) :thumbsup

MetaMan 06-18-2009 09:35 PM

havent gotten it working lol still chugging away

harvey 06-18-2009 11:04 PM

Quote:

Originally Posted by MetaMan (Post 15976614)
havent gotten it working lol still chugging away



the code I posted or SuperSleight?

MetaMan 06-18-2009 11:06 PM

Quote:

Originally Posted by harvey (Post 15976846)
the code I posted or SuperSleight?

the code you posted didnt work for me, im trying a couple other solutions. :)

it could be because im running ie6 beside ie7 but i changed the get so it suites the: <!--[if gt IE 6]> so it would work with the standalone i have.

Mutt 06-19-2009 04:18 AM

http://www.devinrolsen.com/tutorials..._fix/index.php

this is supposedly the latest greatest fix for the issues with png-24 transparency in IE - it does have one or two issues it can't fix but for most cases it works great.

Unit Png Fix from UnitInteractive.com


All times are GMT -7. The time now is 05:08 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123