Agaric Design Collective

IE6 Transparent PNG Fix the Drupal Way

By Benjamin Melançon
on 20 Mar
0 comments

Key words and phrases

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

Tags

Description

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-yo...

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

 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.