Two ways to make IE6 display PNG-24 format images normally

Two ways to make IE6 display PNG-24 format images normally
Method 1:
Please add the following code after </html>

Copy code
The code is as follows:

<!--[if IE 6]>
<script type="text/javascript">
function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span "+ imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src='" + img.src + "', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
correctPNG();
</script>
<![endif]-->

Method 2:

Copy code
The code is as follows:

<!--[if IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
<script type="text/javascript">
DD_belatedPNG.fix('*');
</script>
<![endif]-->

<<:  Linux super detailed gcc upgrade process

>>:  HTML Nine-grid Layout Implementation Method

Recommend

mysqldump parameters you may not know

In the previous article, it was mentioned that th...

Solve the problem of garbled data in MySQL database migration

Under the instructions of my leader, I took over ...

The process of building lamp architecture through docker container

Table of contents 1. Pull the centos image 2. Bui...

Solution to the problem that the docker container cannot be stopped

The solution is as follows: 1. Force delete conta...

Some thoughts and experience sharing on web page (website) design and production

First, before posting! Thanks again to I Want to S...

Summary of basic knowledge points of Linux group

1. Basic Introduction of Linux Group In Linux, ev...

The front-end page pop-up mask prohibits page scrolling

A problem that front-end developers often encount...

Detailed steps to install xml extension in php under linux

Installing XML extension in PHP Linux 1. Enter th...

Several ways to update batches in MySQL

Typically, we use the following SQL statement to ...

Vue2.x configures routing navigation guards to implement user login and exit

Table of contents Preface 1. Configure routing na...

Correct use of Vue function anti-shake and throttling

Preface 1. Debounce: After a high-frequency event...

Usage of mysql timestamp

Preface: Timestamp fields are often used in MySQL...

js canvas realizes random particle effects

This article example shares the specific code of ...

MySQL 8.0.20 installation tutorial and detailed tutorial on installation issues

Original address: https://blog.csdn.net/m0_465798...