zoukankan      html  css  js  c++  java
  • IE6 png图片不透明的解决方法

    IE6 png图片不透明的解决方法


    代码如下:

    <script language="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=\"" + "" + 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 
      } 


    window.attachEvent("onload", correctPNG); 
     </script> 
  • 相关阅读:
    Android theme应用主题实现
    CSS_复习
    复习_数字与字符串
    网络编程
    JAVA--多线程
    File类
    c#中new hisase关键字
    内存泄漏、程序崩溃的排除办法
    解决跨线程问题的几种办法
    c#接口
  • 原文地址:https://www.cnblogs.com/fengju/p/6173755.html
Copyright © 2011-2022 走看看