background image
HomeRecent PostsDrupalSearchTagsRSSContactAboutAccount
Eric.London's picture

I like to use PNGs to create transparent layers and images in my Drupal themes (for the alpha transparency). Unfortunately, lame browsers like IE (5.5 & 6, I think) do not support PNG images. Luckily, Drupal implements jQuery and there are some decent libraries out there to resolve this issue.

I've used the following jQuery library with good luck so far: jquery.pngFix.js

Download the file (pngFix.zip), extract the contents, and copy the file "jquery.pngFix.js" into your theme directory.

In your theme page.tpl.php file you can include the javascript jQuery library using a conditional comment:

<!--[if lt IE 7]>

<!-- include library -->
<script type='text/javascript'
  src='<?php print base_path() . path_to_theme() ?>/jquery.pngFix.js' >
</script>

<!-- enable PNG support -->
<script type='text/javascript'>
  $(document).ready(function(){
    $(document).pngFix();
  });
</script>

<![endif]-->

Now, PNGs should work in IE, like in my header logo :)

Syndicate content