Dd_belatedpng, PNG transparent solution under IE6

Source: Internet
Author: User

We know that IE6 does not support transparent PNG, which undoubtedly limits the space for webpage design.
However, the entire Internet solution to this IE6 transparent PNG solution is also numerous, from the use of IE-specific filters or expressions, and then to JavaScript + transparent GIF alternative. However, these methods haveDisadvantagesThat is, CSS is not supported.Backgrond-PositionAndBackground-repeat.

I will introduce dd_belatedpng today, justOne reasonThat is, it supportsBackgrond-PositionAndBackground-repeat. This is not available for other JS plug-ins. At the same time, dd_belatedpng also supports the: hover attribute and .

View demo

Principle

This JS plug-in uses Microsoft's VML language for rendering, while most other JS plug-ins that solve PNG problems use the alphaimageloader filter.

Usage

1. Download The dd_belatedpng.js file here.
2. Reference in the webpage 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. png_bg to the CSS selector with transparent PNG applied */
</SCRIPT>
<! [Endif] -->

 

 

3. There are two types of calling functions. One is dd_belatedpng.fix (), as shown in the code above. The other is fix (). In this method, the CSS selector name must be specified in the function.

Use a: hover

5-25 update:If you want to use transparent PNG as the background image of a: hover like jutoy, you need to pay attention to your code,Use "A: hover" as the selector.Otherwise, the operation may fail. At the same time, I have updated the demo. Please check the required updates. Then let's take a look.CorrectCode:

   <!--[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 solutions

Other solutions are provided 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.