pngFix
| Menu |
pngFix is a JavaScript class to make transparent png files show up correctly in IE6 and IE5.5.
pngFix is a port of the script found at http://homepage.ntlworld.com/bobosola/pnginfo.htm and clientside.cnet.com/wiki/cnet-libraries/01-browser-fixes website and uses the mootools framework.
This code will only work with mootools Version 1.2 and above.
Requirements:
- to use pngFix v1.0 you will need mootools v1.2 which can be got here
- the ability to apply the code to your XHTML page. (I will help by giving you an example here).
- has been tested on and works in:
- Internet Explorer 6 & 5.5
Download:
The lasetest version of pngFix is v1.0 and you can download form here.
The download files include:
- images
- JavaScript files
- demo
Demo:
You can see a demo here
Example Usage:
To use pngFix is simple. Once you have downloaded mooForms you have to make reference links in the head section of your page like:
- <script type="text/javascript" src="mootools.js"></script>
then before the </body> we reference the pngFix.js and also add the initializing javascript code like so
- <!--[if lt IE 7]>
- <script type="text/javascript" src="pngfix.js"></script>
- <![endif]-->
and then at the bottom of the pngfix.js file add these
- var noPNGSupport = (document.body.filters) ? true : false;
- if (noPNGSupport) new pngFix();
this now should fix all png files on page load. To add any options see below
Options:
In this class we have options that we have to set, if you don't want the default options that is.
The default options are:
cssBgElements: null,
initializeOnLoad: true
What does this mean?
-el: element, the element with the png files to fix defaults to document.body.
-cssBgElements: Any number of the following as arguments are accepted: HTMLCollections, arrays of elements, elements, or strings as selectors, defaults to null .
-initializeOnLoad: boolean, set to fix png's on page load, defaults to true.
If you miss any or all the options out then the default options are used
Now enjoy.
Main Menu
Ubuntu
Donate
Site Specs
Site best viewed in a screen resolution of 1024x768 & 32 bit colours or higher using the latest version of Firefox
