Png-8 mode of the image, if there is no gradient is transparent, if there is a gradient is not transparent. JS support is required.
Function Correctpng () // Correctly handle PNG transparency in win IE 5.5 & 6.
{
VaR Arversion = Navigator. appversion. Split ( " MSIE " )
VaR Version = Parsefloat (arversion [ 1 ])
If (Version > = 5.5 ) && (Document. Body. filters )){
For ( VaR J = 0 ; J < Document. Images. length; j ++ ){
VaR IMG = Document. Images [J]
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.css text
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
J = J - 1
}
}
}
}
Window. attachevent ( " Onload " , Correctpng );