User login

IE6 Transparent PNG Fix the Drupal Way

This is the IM conversation on implementing a jQuery ie6 PNG fix. Dan's elegant solution will go below... i don't quite follow where he put everything...

dan:
http://jquery.andreaseberhard.de/pngFix/

just dump it in the theme folder?

benjamin melançon:
yeah

and http://api.drupal.org/api/function/drupal_add_js/5

and then of course
<head>
...
<script type="text/javascript">
   $(document).ready(function(){
       $(document).pngFix();
   });
</script>
...
</head>

has to be added to all five of your page.tpl.phps

dan:
can you gimme the exact line please?

ben:
assuming you put the file directly in the your theme's directory

drupal_add_js('jquery.pngFix.js', 'theme');

dan:
just put that in the head area?

benjamin melançon
no, that goes in template.php

http://www.johnandcailin.com/blog/john/using-jquery-place-prompt-text-your-exposed-drupal-filters

hmm, looks like i was counting on the 'theme' setting to find your theme, and really all it does is find the theme directory? a little strange

but if that's the case you'll have to have something like:
<?php
$theme_path = drupal_get_path('theme', 'zen');
drupal_add_js($theme_path . '/js/inlineFieldLabel.js','theme');
?>

dan hak 11:53
this in what i used :
<?php
drupal_add_js(drupal_get_path('theme', 'sky') . '/jquery.pngFix.js', 'theme');
?>

so there!

benjamin melançon 11:53
good for you!

one second

<?php
drupal_add_js(
'$(document).ready(function(){
       $(document).pngFix();
   });' ,
'inline'
);
?>

that last one

in template.php

may mean you don't need to edit any of the page.tpl.phps

as is

Resolution

Searched words: 
Microsoft Internet Explorer Six 6 six (yes, three sixes) transparency portable network graphic pngs images

Comments

I have recently written this

I have recently written this article to show you how to export png 8 in Fireworks. http://tocs-i.com/blog/how-to-export-transparent-pngs-from-fireworks-that-have-a-small-file-size-and-work-in-ie6/

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.