Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Posts
    114
    Thanks
    14
    Thanked 0 Times in 0 Posts

    looks bad in IE, sugguestions?

    http://norcaldesigns.sytes.net/norcal/norcal

    Well since IE doesn't support transparent pngs is there anyway to get the left and right border to look good? Any way to have a flash file with the png in it and transparent background auto-size to the height of the content? Any other sugguestions?

    It looks the way it is supposed to in FireFox, stupid IE

  • #2
    Regular Coder MrBiggZ's Avatar
    Join Date
    Apr 2005
    Location
    Indianapolis IN
    Posts
    345
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Thumbs up

    You can use png file in IE6. I did!

    First put this file in your websites root directory and name it pngfix.js Here's the code, just copy it paste it into a new test file and change the name to pngfix.js

    Code:
    // Correctly handle PNG transparency in Win IE 5.5 or higher.
    // http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
    
    function correctPNG() 
       {
       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);
    Next ... in the head section of your webpage put this:

    Code:
    <!--[if gte IE 5.5000]>
    <script type="text/javascript" src="pngfix.js"></script>
    <![endif]-->
    If you don't believe me .. you can see it for real on my site http://handler.homeip.net/test1.php The logo at the top is a png graphic!

    Hope this help!

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Posts
    114
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Ahh it sounds like the solution to my last remaining problem!!...

    only i tried it and it didn't work Any ideas? Thanks,
    -Jesse (I left the code up on the site if u wanna check for errors, but i pasted it exactly and even tried dloading the one from your site and substituting that but no luck so im lost)
    Last edited by jpolo9; 04-18-2005 at 03:29 AM.

  • #4
    Regular Coder MrBiggZ's Avatar
    Join Date
    Apr 2005
    Location
    Indianapolis IN
    Posts
    345
    Thanks
    44
    Thanked 2 Times in 2 Posts
    I think I neglected to supply something. Stick this class inside of your img tag.
    class="pagegraphic" See if that works. Here's the link to where I got this code from. http://homepage.ntlworld.com/bobosola/index.htm


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •