Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] DZX顶部LOGO在IE6下不透明终级解决方案

[复制链接]
gamemx 发表于 2010-9-22 21:59:17 | 显示全部楼层 |阅读模式
本帖最后由 gamemx 于 2010-9-22 22:02 编辑

DZX后台——全局——优化设置——其他头部信息:

加入如下代码,可撤底解决PNG图片在IE6下不透明问题,好用就帮顶一下,谢谢

  1. <!-- PNG透明开始 -->
  2. <script language="JavaScript">
  3. function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
  4. {
  5.     var arVersion = navigator.appVersion.split("MSIE")
  6.     var version = parseFloat(arVersion[1])
  7.     if ((version >= 5.5) && (document.body.filters))
  8.     {
  9.        for(var j=0; j<document.images.length; j++)
  10.        {
  11.           var img = document.images[j]
  12.           var imgName = img.src.toUpperCase()
  13.           if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  14.           {
  15.              var imgID = (img.id) ? "id='" + img.id + "' " : ""
  16.              var imgClass = (img.className) ? "class='" + img.className + "' " : ""
  17.              var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" +

  18. img.alt + "' "
  19.              var imgStyle = "display:inline-block;" + img.style.cssText
  20.              if (img.align == "left") imgStyle = "float:left;" + imgStyle
  21.              if (img.align == "right") imgStyle = "float:right;" + imgStyle
  22.              if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
  23.              var strNewHTML = "<span " + imgID + imgClass + imgTitle
  24.              + " style="" + "width:" + img.width + "px; height:" + img.height +

  25. "px;" + imgStyle + ";"
  26.              + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
  27.              + "(src=\'" + img.src + "\', sizingMethod='scale');"></span>"
  28.              img.outerHTML = strNewHTML
  29.              j = j-1
  30.           }
  31.        }
  32.     }     
  33. }
  34. window.attachEvent("onload", correctPNG);
  35. </script>
  36. <!-- PNG透明始束 -->
复制代码

评分

1

查看全部评分

三顾茅庐 发表于 2010-9-22 22:00:43 | 显示全部楼层
.........

评分

1

查看全部评分

回复

使用道具 举报

37ws.com 发表于 2010-9-22 22:37:14 | 显示全部楼层
很赞,,用上了 www.37ws.com
回复

使用道具 举报

yuhoucaixia 发表于 2010-9-23 09:34:40 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

yuhoucaixia 发表于 2010-9-23 09:37:20 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

Ddesign 发表于 2010-9-23 09:45:22 | 显示全部楼层
回复

使用道具 举报

J16988 发表于 2010-9-23 19:14:56 | 显示全部楼层
回复

使用道具 举报

lizypen 发表于 2010-9-23 19:55:08 | 显示全部楼层
真实有效,有站为证:http://www.alt0906.cn
回复

使用道具 举报

3583101io 发表于 2010-9-23 20:29:25 | 显示全部楼层
本帖最后由 3583101io 于 2010-9-23 20:29 编辑

支持了啦!!!
回复

使用道具 举报

王海东 发表于 2010-9-23 21:47:06 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-17 04:04 , Processed in 0.127106 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表