User login

IE6 Transparent PNG Fix the Drupal Way

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

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

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • 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>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

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