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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 布瓜去旅行

适时放手,是对自己的尊重 PhoneGap初试! 【转】Swift之 ? 和 ! 一场空欢喜 不要悲伤,我亲爱的好姑娘 更新证书错误:No matching provisioning profiles found CABasicAnimation的基本使用方法(移动·旋转·放大·缩小) ASP.NET中解决跨子域的Session共享 iPhone4S出现应用无法打开时的解决方案 [转] XCode 4.2 新功能 - Storyboard [摘] Objective-C的self.用法的一些总结 C# winform 与 flash as 的交互通讯 IE6中正确显示png图片 IE6中margin值双倍的解决方案 [转] 弹性+固宽布局 Windows2003下配置PHP环境 去除Visual Studio .NET工程同SourceSafe的关联 遭遇价格欺诈 塑料瓶底的标志的含义!
【转】DD_belatedPNG,解决IE6不支持PNG绝佳方案
布瓜去旅行 · 2011-08-22 · via 博客园 - 布瓜去旅行

原文地址:http://www.ediyang.com/dd_belatedpng-best-way-support-ie6-png/#comment-16610

  我们知道IE6是不支持透明的PNG的,这无疑限制了网页设计的发挥空间.
  然而整个互联网上解决这个IE6的透明PNG的方案也是多不胜数,从使用IE特有的滤镜或是expression,再到javascript+透明GIF替代.但是这些方法都有一个缺点,就是不支持CSS中backgrond-position与background-repeat.

  而我今天介绍DD_belatedPNG,只需要一个理由,就是它支持backgrond-position与background-repeat.这是其他js插件不具备的.同时DD_belatedPNG还支持a:hover属性,以及<img>.

  看Demo

  原理
  这个js插件使用了微软的VML语言进行绘制,而其他多数解决PNG问题的js插件用的是AlphaImageLoader滤镜.

  使用方法
  1.在这里下载DD_belatedPNG.js文件.
  2.在网页中引用,如下:

<!--[if IE 6]>
<script src="DD_belatedPNG.js" mce_src="DD_belatedPNG.js"></script>
<script type="text/javascript"><!
<!
/* EXAMPLE */
DD_belatedPNG.fix(
'.png_bg');
/* 将 .png_bg 改成你应用了透明PNG的CSS选择器,例如我例子中的'.trans'*/
// -->


  3.有2种调用函数,一种是DD_belatedPNG.fix(),如上代码.另一种是fix(),这中方法需要在函数内指出css选择器名.

  使用a:hover请留意
  5-25更新:如果你也像jutoy同学一样想要用透明PNG作为a:hover时的背景图片,那么你需要留意你的代码,需要以”a:hover”来作为选择器.否则可能会导致无法成功.同时我也更新了demo,请需要的更新查看.接着我们看看正确的代码:

<!--[if IE 6]>
 
<script type="text/javascript" src="js/DD_belatedPNG.js" ></script>
 
<script type="text/javascript">
 DD_belatedPNG.fix(
'.trans,.box a:hover');
 
</script>
<![endif]-->