惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

博客园 - 无声雨

远程桌面不能复制粘贴到本地的解决办法 操作文件或者文件夹做硬连接 使用Google Map获取地址坐标 SharePoint2010 安装时报“未能启动数据库服务 MSSQL$Sharepoint"解决办法 解决OracleDBConsoleorcl服务无法启动问题[转帖] oracle10g dbconsole 重建步骤(转帖) 做个记号,VS2008中选择默认环境 SQLServer2005SP2安装时提示KB921896错误 Asp.Net2.0中TreeView使用javascript客户端实现选择节点联动的脚本 WindowsXp系统时services.exe占用内存和CPU资源的问题 EXT中GRID自动适应宽与高 Grid使用动态数据源的问题 关于韩文等文字存储乱码的问题 EXT中的语言包 Ext中tree的研究 使用ASP生成条形码(转) IE地址栏javascript代码(转) 设置双网卡同时访问内外网 BAT文件的妙用(转)
IE6下PNG图片对象以及其作为背景透明的处理
无声雨 · 2008-04-09 · via 博客园 - 无声雨

图片对象

function correctPNG() 

var arVersion = navigator.appVersion.split("MSIE");
 
var version = parseFloat(arVersion[1]);
 
if ((version >= 5.5&& (version < 7&& (document.body.filters)){
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-1 
}
 
}
 
}
 
}

然后直接onLoad该方法就可以了

如果要将PNG做为背景,并且使得其透明,则可以使用如下样式:

background: url(图片地址) center repeat-y !important;
background:none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='图片地址',sizingMethod='scale');