Solution IE6 PNG Transparent JS plug-in use introduction _javascript tips

Source: Internet
Author: User
IE6 's PNG transparency is an old problem, and recently a friend asked me if I had the best plugin to solve the problem. Although know and use dd_belatedpng this plug-in, today take time to send this up.

Although a jquery PNG plugin was previously posted on the blog, it does not support background tiling.
Dd_belatedpng uses the Microsoft VML language to repaint PNG images to achieve translucent effects, and supports Background-position and Background-repeat properties to support pseudo classes. is a good recommended plug-ins, the use is relatively simple.

How to use:
Copy Code code as follows:

<!--[if IE 6]>
<script src= "Dd_belatedpng.js" ></script>
<script>
Dd_belatedpng.fix ('. Png_bg ');
</script>
<! [endif]-->

The reference function is Dd_belatedpng.fix (), and the. PNG_BG in parentheses is changed to your CSS selector name.
ID Selector Example:
Copy Code code as follows:

Dd_belatedpng.fix (' #png ');

Pseudo Class Example:
Copy Code code as follows:

Dd_belatedpng.fix ('. png a:hover,.png a:focus ');

IMG Tag Example:
Copy Code code as follows:

Dd_belatedpng.fix (' img ');

If more than one direct comma (in English) on the line. For example:
Copy Code code as follows:

Dd_belatedpng.fix ('. PNG_BG, #png,. png a:hover,.png a:focus,img ');

How to use:
Copy Code code as follows:

<!--[if IE 6]>
<script type= "Text/javascript" src= "Js/dd_png.js" ></script>
<script type= "Text/javascript" >
Dd_belatedpng.fix ('. tel,.head_content ');
</script>
<! [endif]-->

The bracket is a style selector, separated by commas in the middle.
JS File Download Address:
0.0.8a-min.js (compressed version)

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.