Pngfix

Pngfix

From ThaiiS Note (Wiki)

Jump to: navigation, search

Contents

iepngfix.htc

Follow these simple steps to add this to your page:

1. Copy and paste iepngfix.htc and blank.gif into your website folder. 2. Copy and paste this into your website's CSS or HTML:

          
<style type="text/css">
img, div { behavior: url(iepngfix.htc) }
</style>

That CSS selector must include the tags/elements on which you want PNG support -- basically, give it a comma-separated list of tags you use. It must also include the correct path to the .HTC relative to the HTML document location (not relative to the CSS document!). For instance, yours may look like this:

<style type="text/css">
img, div, a, input { behavior: url(/css/resources/iepngfix.htc) }
</style>

or put to scc file

<link href="png.css" rel="stylesheet" type="text/css" />

3. If your site uses subfolders, open the .HTC file in a text editor like Windows Notepad and change the blankImg variable to include a correct path to blank.gif like so:

var blankImg = '/images/blank.gif';

Again the path is relative to the HTML file. Otherwise, you will see a "broken image" graphic!

4. Sit back and enjoy! Perhaps consider making a donation to support this script's development if you like what you see, as I have spent hundreds of hours developing, testing and supporting it :). Alternatively, I would certainly appreciate a crediting link on your site back to mine!


IE5.5+ PNG Alpha Fix v1.0

[show details]

blank.gif

blank.gif URL can use absolute path

blankImg = 'http://domain/pathto/blank.gif';

Image:blank.gifMedia:blank.gif

Author & Download Full

online demonstration.

fixed on word press

change from

#yourdiv {behavior: url(iepngfix.htc)}

to

#yourdiv {behavior: url(<?php bloginfo('wpurl'); ?>/path-to/iepngfix.htc)}


on header.php

<style type="text/css">
<!--
#yourdiv,img {behavior: url(<?php bloginfo('wpurl'); ?>/path-to/iepngfix.htc)}
-->
</style>

same result between

  • <?php bloginfo('wpurl'); ?> and
  • <?php bloginfo('url'); ?>

fixed for jquery cycle on IE 7-8

cleartypeNoBg: true,

if IE

<!--[if IE ]>
<style type="text/css">
IMG, DIV { behavior: url(iepngfix.htc); }
</style>
<![endif]-->
Retrieved from "http://www.thaiis.eu/Pngfix"