In Danland presentation is writed that Danlan use: jQuery pngFix Plugin by Andreas Eberhard.
I have made all of my files which need transparency as PNG file. Than I have seen that png file have no transparency on IE6.
Sorry if my question is dumb but I'm not good on javascript.

I have added in danland.info:
scripts[] = scripts/jquery.pngFix.js

Now I try to Activate pngFix as is writed on http://jquery.andreaseberhard.de/pngFix/ only when browser is IE.
I suppose is necessary to include in template.php file something like:
drupal_add_js('$(function(){$('div.logo').pngFix();});' );

Could you give help with this issue, or show an example how you used pngFix.

Thanks

Comments

danpros’s picture

Status: Active » Fixed

Hi,

First if you only want the script loaded if the browser is IE6 then do not call that via danland.info but use template.php instead.

In Danland 7.x template.php already available this code

function danland_preprocess_html(&$vars) {
  // Add conditional CSS for IE6.
drupal_add_css(path_to_theme() . '/style.ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
}

so it should become like this

function danland_preprocess_html(&$vars) {
  // Add conditional CSS and JS for IE6.
drupal_add_css(path_to_theme() . '/style.ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
drupal_add_js(path_to_theme() . '/scripts/jquery.pngFix.js', array('group' => JS_THEME, 'browsers' => array('IE' => 'IE 6', '!IE' => FALSE), 'preprocess' => FALSE));
}

and last add the folowing code to the jquery.pngFix.js

    jQuery(document).ready(function($)  {
        $('div.logo').pngFix();
    });

Dan

ccflor’s picture

Thank you very much. I worked almost one day to solve this problem and now with your help it's ready in 5 minutes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.