JavaScript achieves transparent PNG images under IE6

Source: Internet
Author: User

The tutorial of helper home (www.bkjia.com) has been engaged in web page design for many years. Every time you encounter a problem, you will waste a lot of time searching for special effect code of JavaScript (java script, therefore, every lazy hacker will save the JS special effect code for each problem for later use. The lazy hacker shares all the JS special effect codes accumulated over the years, hoping to save some time for everyone. If you have any questions, leave a message to discuss them. This time, the Javascript special effect code to be shared by the lazy hacker is the JS special effect code for the transparent effect of PNG images in IE6.

When looking for the JS special effect code for PNG images with transparent effects, the lazy hacker found that most of the effects can only be transparent under IE6. When PNG images are used as the background, this effect does not work. Next, I want to share the JS special effect code to achieve this effect.

The JS special effect code of PNG Image transparency under IE6 uses behavior technology, and it does not matter if the Code does not understand it. We just need to use it.

Of course, this JS special effect code is only the core code. For all the code, please click the download link at the bottom of the article to download the PNG Image transparency effect under IE6. The following will show you how to use it, the procedure can be simplified to the following three steps:

• Step 1: Upload the beibeibeiiepngfix.htc?and shanghaiyun.gif files to your project

• Step 2: Use the appropriate selector to enable "behavior: url (" iepngfix. htc ")" on a PNG image that is transparent to IE6 or a container that requires transparent background image ");"

• Step 3: If you want the background png image of the container to have a transparent effect, you also need to introduce the iepngfix_tilebg.js script in the page (of course, if you do not want to use the transparent png background image effect of the container, you can also disable this js file)

Of course, the entire solution also has disadvantages-one or two files need to be referenced (iepngfix. htc and iepngfix_tilebg.js files ). I have referenced these two files in the project and found that the opening speed is much slower. It may also be related to the code of the project or other software and hardware. However, removing the iepngfix_tilebg.js file does not have much impact, therefore, if it is not necessary to reference this file as far as possible, it depends on your own requirements.

Attachment download >>>

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.