Perfect solution for PNG Image transparency under IE6-dd_belatedpng from www.jqueryba.com)

Source: Internet
Author: User

Today, feixian started early. We collected plug-ins to share with you-dd_belatedpng plug-ins, which can make the image transparent. This solution only requires one reason, that is, it supports backgrond-position and background-repeat. this is not available for other JS plug-ins. dd_belatedpng also supports the: hover attribute and .
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.
Http://dillerdesign.com/experiment/DD_belatedPNG/#download (with full and compressed versions)
2. Use the downloaded JS call
<SCRIPT type = "text/JavaScript" src = "downloaded JS path"> </SCRIPT>
And then reference it on the PNG page. Code , Because it is for IE6 processing, so add IE6 conditional annotations on the periphery, in order to distinguish it from other browsers. The complete code is as follows:
<! -[If gte ie 6]>
<SCRIPT type = "text/JavaScript" src = "downloaded JS path"> </SCRIPT>
<SCRIPT type = "text/JavaScript"> dd_belatedpng.fix ('css selector, application type'); </SCRIPT>
<! [Endif]->
The reference function is dd_belatedpng.fix (). Fill in the CSS selector that applies PNG (ID selector and class selector can be used) and application type (IMG and background) in brackets ).
Such as dd_belatedpng.fix ('# Box-one, IMG') or dd_belatedpng.fix ('. header, background.
These can be abbreviated as dd_belatedpng.fix ('# Box-one,. header, IMG, background ');.
For more selectors, such as dd_belatedpng.fix ('# Box-one,. header, # footer,. Box-two A: hover, IMG, background'); and so on.
TIPS: note that the punctuation of the selector must be in English; otherwise, it will be ineffective!

Jquery http://www.jqueryba.com/165.html

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.