DD_belatedPNG, PNG transparent solution under IE6 (foreign) _ javascript skills

Source: Internet
Author: User
To introduce DD_belatedPNG today, we only need one reason: it supports backgrond-position and background-repeat. this is not available for other js plug-ins. 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 e-xpression, and then to javascript + transparent GIF alternative. however, these methods do not support backgrond-position and background-repeat in CSS.

The only reason I want to introduce DD_belatedPNG today is that it supports backgrond-position and background-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:

The Code is as follows:




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 for a: hover like jutoy, you need to pay attention to your code and use ": as a selector. otherwise, the operation may fail. I also updated the demo. Please check the updates. next let's look at the correct code:

The Code is as follows:




Other solutions
Other solutions are provided here for your reference.
  • Unit PNG Fix
  • Ie7-js
  • Ie png Fix
Related Article

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.