Reply
Transparent PNG help needed urgently!
Old 10-05-2007, 01:44 PM Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
I've long been having problems with my PNG files and Internet Explorer ever since I got a guy to design one here on Webmaster-Talk for me.

Has anyone got a fix for these? I've Googled around and seen numerous methods (Javascript, PHP, blank gifs and more) but whenever I actually try these, they never work!

Has someone got a SIMPLE method of getting IE6 to support transparent PNGs somehow?

Thanks in advance,
Dan
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote
View Public Profile Visit whym's homepage!
 
When You Register, These Ads Go Away!
Old 10-05-2007, 02:43 PM Re: Transparent PNG help needed urgently!
Novice Talker

Posts: 14
Name: kiran
Ie always got a problem with png files, i dont think there you can go around that with png, the easy way though is using a gif file , gif files also can produce good quality images if properly optimised with a good alpha challel too. so try gif stuff
__________________
for low cost php programming and affordable webdesign webdesignseo.co.uk

Last edited by kiranshotgun : 10-07-2007 at 07:40 PM.
kiranshotgun is offline
Reply With Quote
View Public Profile
 
Old 10-05-2007, 02:51 PM Re: Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
Look, firstly stop self promoting in this thread. I want to work in web design - therefore I need to learn - I don't want to pay some guy I don't know to code my entire site for me.

Secondly, there are work-arounds with transparent PNGs - I just want a personal recommendation from a member about which one to use and which is easiest to do and understand.
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote
View Public Profile Visit whym's homepage!
 
Old 10-05-2007, 03:09 PM Re: Transparent PNG help needed urgently!
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
I tried a .htc file for it, but I didn't something wrong or it failed, and didn't work. Thankfully, I run a website with a high proportion of techie type people, so it doesn't matter. You'd probably get it to work, so it's an option at least.
__________________
Foundation Flash tutorials : www.foundation-flash.com

New Dreamed Up Web Design: www.dreamedupdesign.com
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 10-05-2007, 03:56 PM Re: Transparent PNG help needed urgently!
LadynRed's Avatar
Super Moderator

Posts: 6,743
Location: Tennessee
The fix for transparent PNGS in IE 6 (and below) will only work for a NON-REPEATING image. So, if you're trying to use it for a background, the htc and js solutions will not work.

I used the HTC png fix method on this site: www.sanomsfreeedgesalon.com - for the menu bars, it does work.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-05-2007, 09:32 PM Re: Transparent PNG help needed urgently!
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
Quote:
Originally Posted by whym View Post
Secondly, there are work-arounds with transparent PNGs - I just want a personal recommendation from a member about which one to use and which is easiest to do and understand.
You can use the filter faux-css which is built into IE, but otherwise completely invalid. There's a javascript that finds png files and applies this for you in the page load event, but I've never had much luck with it.

I wound up using gifs instead for most images that demand transparency. Another option is to call out tho a gif or png using two different stylesheets and calling out to one of them after a little browser sniffing, either on the server, or in the browser.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 10-06-2007, 12:21 PM Re: Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
OK I seriously need help on this - I've spent most of today now fumbling around trying to find a fix for IE6 on this and I seriously can't get anything I upload/incorporate to work!

Check out my redesign and the CSS at the moment - I've got a file at http://whymhost.co.uk/redesign/pngHack.htc which is supposed to fix this and also a transparent gif at http://whymhost.co.uk/redesign/transparent.gif, which is required by the script.

If someone can actually get this working, I'm more than happy to give you Talkupation - I'm getting a headache from all of these IE bugs!
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote
View Public Profile Visit whym's homepage!
 
Old 10-06-2007, 12:32 PM Re: Transparent PNG help needed urgently!
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
I am getting a 403 error when attempting to view both links.
joder is offline
Reply With Quote
View Public Profile
 
Old 10-06-2007, 12:49 PM Re: Transparent PNG help needed urgently!
maxxximus's Avatar
Extreme Talker

Posts: 206
Name: Rob
Location: UK
Ok Bud this will work for transparent pngs in IE6.

You need the Js script fixpng.js below and a >IE5.5 conditional statement in the head of the doc.

<!--[if gte IE 5.5000]>
<script type="text/javascript" src="fixpng.js></script>
<![endif]-->

Code:
// JavaScript Document
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);
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 10-06-2007, 12:58 PM Re: Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
Thanks for the code - however, now IE6 is displaying a blank/white screen when visiting the site!
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote
View Public Profile Visit whym's homepage!
 
Old 10-06-2007, 01:12 PM Re: Transparent PNG help needed urgently!
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
Since you are using a solid background color, make an image the same size filled with your sites bg color, then copy your png on to it and save as a jpg.
joder is offline
Reply With Quote
View Public Profile
 
Old 10-06-2007, 01:18 PM Re: Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
Are you sure there isn't another way that this could be done - I'd prefer not to restrict myself to a certain image size as the background.
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote
View Public Profile Visit whym's homepage!
 
Old 10-06-2007, 09:29 PM Re: Transparent PNG help needed urgently!
chrishirst's Avatar
Super Moderator

Posts: 15,315
Location: Blackpool. UK
Have you tried post #2 in the Reference Resources sticky thread in this forum ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-07-2007, 03:23 AM Re: Transparent PNG help needed urgently!
maxxximus's Avatar
Extreme Talker

Posts: 206
Name: Rob
Location: UK
Your problem is that you have given a png file a GIF extension. Your logo.GIF should be saved as logo.png.

This works in IE6 using the Js code I posted - no blank screens.

Has to be said that your not making use of the logos transparency. You could have achieved this by giving it a background colour to match.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Whym Web Hosting, based in Presteigne</title>

<meta name="keywords" content="whym web hosting, herefordshire, presteigne, knighton, kington, llandrindod wells, herefordshire, leominster,  internet services, whym, mid wales, hosting, host, powys, stapleton, hereford, cpanel, the whym, presteigne web hosting, whym host" />

<meta name="description" content="Whym is a small company providing reliable web site hosting for individuals and small companies in Mid-Wales and Herefordshire" />

<link rel="stylesheet" href="http://whymhost.co.uk/redesign/style.css" type="text/css" />
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="http://whymhost.co.uk/redesign/fixpng.js"></script>
<![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" href="iefixes.css" /><![endif]-->

<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>

</head>

<body>

<div id="container">
<img class="floatLeft" src="logo.png" alt="Whym Web Hosting logo" width="193" height="100" />
<div class="menu">

<ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">FAQ</a></li>
        <li><a href="#">Support</a>

             <ul>
                 <li><a href="#">Video tutorials</a></li>
             </ul>
      </li>
        <li><a href="#">Login</a><!--[if lte IE 6]><table><tr><td><![endif]-->
             <ul>
               <li><a href="#">cPanel</a></li>

               <li><a href="#">Webmail</a></li>
               <li><a href="#">Billing</a></li>
             </ul>
                <!--[if lte IE 6]></td></tr></table></a><![endif]--> 
        </li>
        <li><a href="#">Contact</a></li>
</ul>  
</div>

<div id="contactInfo"><p>Looking for support? &nbsp; <a href="mailto:support@whymhost.co.uk">E-mail</a> &nbsp;<a href="skype:whymweb" onclick="return skypeCheck();">Skype</a>&nbsp; <a href="">Ticket</a></p></div>

<div id="intro">
<p><img class="floatRight" src="http://whymhost.co.uk/servers2.jpg" alt="Web servers" width="289" height="235" />
Whym is a small company providing web hosting for the Herefordshire and Mid Wales area of the UK. All of our packages combine reliability, affordability and great support with plenty of features, to meet the needs of all of our customers.
<br />
<br /> 
Whether you require hosting for a personal web site or for a small company, you can guarantee that your needs will be met through our extensive packages. Each of these include an easy-to-use, web-based control panel to administer your site and also an easy wizard to create your web site from hand, should you require it. If your needs ever change, upgrading is easy and seamless too.</p>
</div>

<div id="packages">
<h2>Hosting packages</h2>
<div id="allFeatures">
<p>All packages come with:</p>
<ul>
<li>cPanel, a web-based control panel to administer your site</li>
<li>A plugin to cPanel, called Fantastico, allowing you to easily install software packages such as shopping carts, onto your site</li>
<li>RVSiteBuilder for building sites at the click of a button, without need for knowledge of programming</li>
<li>Chatrooms and bulletin boards</li>
<li>Agora shopping cart</li>

<li>Web statistics</li>
<li>Powerful security features</li>
<li>CGI server access</li>
<li>Support for Microsoft Frontpage and Ruby on Rails</li>
<li>Inclusive email, Skype, MSN and ticket support</li>
</ul>
<a href="">More about the features and what they mean</a></div>

<div id="cone">
<h3>Cone</h3>

<ul>
<li class="resourceAmounts">Web storage space: 300MB</li>
<li class="resourceAmounts">Traffic usage allowance: 1500MB</li>
<li>1 FTP account for file transfers</li>
<li>5 email accounts with 5 mailing lists</li>
<li>1 MySQL database</li>
<li>5 subdomains</li>
<li>5 parked and addon domains</li>
<li class="price">&pound;3.99 a month</li>

</ul>
<a href="">Order now</a>
</div>

<div id="cube">
<h3>Cube</h3>
<ul>
<li class="resourceAmounts">Web storage space: 750MB</li>
<li class="resourceAmounts">Traffic usage allowance: 3000MB</li>
<li>5 FTP accounts for file transfers</li>
<li>10 email accounts with 50 mailing lists</li>

<li>5 MySQL databases</li>
<li>20 subdomains</li>
<li>20 parked and addon domains</li>
<li class="price">&pound;7.99 per month</li>
</ul>
<a href="">Order now</a>
</div>

<div id="sphere">
<h3>Sphere</h3>
<ul>

<li class="resourceAmounts">Web storage space: 1200MB</li>
<li class="resourceAmounts">Traffic usage allowance: 7500MB</li>
<li>20 FTP accounts for file transfers</li>
<li>50 email accounts with 100 mailing lists</li>
<li>20 MySQL databases</li>
<li>100 subdomains</li>
<li>50 parked and addon domains</li>
<li>Shell server access</li>
<li class="price">&pound;11.99 per month</li>

</ul>
<a href="">Order now</a>
</div>
</div>

<div id="footer">
<p>&copy;2007 Whym Web Hosting &nbsp;<a href="">Terms</a> &nbsp;<a href="">Privacy Policy</a></p>
</div>

</div>
</body>
</html>

Last edited by maxxximus : 10-07-2007 at 03:27 AM.
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 10-07-2007, 02:56 PM Re: Transparent PNG help needed urgently!
whym's Avatar
Putting food on my family

Posts: 3,429
Name: Daniel
Location: A sleepy town in Mid Wales
Correct me if I'm wrong, but it's still mucked up on my site even after I've added this Javascript and the code exactly as you said.

This issue is really beginning to wear me out - please please please someone get this issue fixed!
__________________
Whym Web Design - article blog| Personal blog

I need your help - sponsor me!
whym is offline
Reply With Quote