Dd_belatedpng,ie6 PNG Transparent solution (foreign) _javascript tips

Source: Internet
Author: User
We know that IE6 does not support transparent PNG, which undoubtedly limits the space for web design to play.
However, the solution to this IE6 transparent PNG on the Internet is numerous, from using IE-specific filters or expression, to javascript+ transparent gif substitution. But these methods have one drawback, is not to support backgrond-position and background-repeat in CSS.

And I introduce dd_belatedpng today, only need one reason, is IT support backgrond-position and background-repeat. This is not available for other JS Plug-ins. Dd_belatedpng also supports a:hover properties , as well as .

See Demo

Principle
This JS plugin uses Microsoft's VML language for rendering, while most other JS plug-ins that solve the PNG problem use the AlphaImageLoader filter.

How to use
1. Download the Dd_belatedpng.js file here.
2. Refer to the Web page as follows:

Copy Code code as follows:

<!--[If LTE IE 6]>
<script src= "Js/dd_belatedpng_0.0.8a.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >
Dd_belatedpng.fix (' Div, UL, IMG, Li, input, a,. png_bg ');
/* Change the. PNG_BG to the CSS selector you applied transparent PNG.
</script>
<! [endif]-->

3. There are 2 kinds of call functions, one is Dd_belatedpng.fix (), as above code. The other is fix (), which requires the CSS selector name to be indicated within the function.

Please pay attention to the use of a:hover
5-25 Update: If you want to use transparent PNG as a background image for a:hover as well as Jutoy, then you need to pay attention to your code and use "A:hover" as your selector. Otherwise, it may result in an unsuccessful attempt. And I also updated the demo, Please view the updates you want. And then we look at the correct code:
Copy Code code as follows:

<!--[if IE 6]>
<script type= "Text/javascript" src= "Js/dd_belatedpng.js" ></script>
<script type= "Text/javascript" >
Dd_belatedpng.fix ('. Trans,.box a:hover ');
</script>
<! [endif]-->

Other programmes
There are other options available here for your reference.
    • Unit PNG Fix
    • Ie7-js
    • IE PNG Fix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.