应该使用哪个 jQuery 插件来修复 IE6 PNG 透明度问题?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/60740/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 08:40:58  来源:igfitidea点击:

Which jQuery plugin should be used to fix the IE6 PNG transparency issue?

jqueryinternet-explorer-6png

提问by Brian Boatright

Is there an IE6/PNG fix that is officially developed by the jQuery team?

是否有 jQuery 团队正式开发的 IE6/PNG 修复程序?

If not which of the available plugins should I use?

如果不是,我应该使用哪些可用的插件?

采纳答案by alexp206

I'm using jquery.pngFix.js. I don't know if it's officially sanctioned or not, I do know that it works. I chose it because it was the plugin included with FancyBox, no other reason.

我正在使用jquery.pngFix.js。我不知道它是否得到官方批准,我知道它有效。我选择它是因为它是 FancyBox 附带的插件,没有其他原因。

回答by dizzy_fingers

This .htc pngfixhas always worked for me, even in cases where the jquery plugin failed.

这个.htc pngfix一直对我有用,即使在 jquery 插件失败的情况下也是如此。

回答by dizzy_fingers

Check this out. Some people mention jQuery plugins in the comments as well.

看一下这个。有些人也在评论中提到了 jQuery 插件。

PNG Fix from 24 Ways

从 24 种方式修复 PNG

回答by Guilherme Santos

Hello Guyz, Here is my Fix to this problem

你好 Guyz,这是我对这个问题的修复

Download jQuery-Plugin "pngFix" from (http://jquery.andreaseberhard.de) Great PlugIn By The Way!!!

从 ( http://jquery.andreaseberhard.de)下载 jQuery-Plugin "pngFix"很棒的插件!

--Change these lines like the following:

-- 更改这些行,如下所示:

// this line
jQuery(this).find("img[src$=.png]:visible").each(function() { 
// this line
jQuery(this).find(":visible").each(function(){
// and this line
jQuery(this).find("input[src$=.png]:visible").each(function() {

--Before the end Place this Code

--在最后放置此代码

// Store a reference to the original method.
var _show = jQuery.fn.show;

// Overriding Show method.
jQuery.fn.show = function(){
  // Execute the original method.
  _show.apply( this, arguments );
  // Fix Png 
  return $(this).pngFix();
}

//No more problems with hidden images

})(jQuery);

//The End

回答by KrazyKen04

Hey guys, just wanted to toss this one in. I was digging around for it again and it has one specific advantage over the rest: repeatable backgrounds, as well as background-position (the one thats flagged as the best answer here actually just scales the background image).

嘿伙计们,只是想把这个扔进去。我又在找它了,它比其他的有一个特殊的优势:可重复的背景,以及背景位置(这里标记为最佳答案的那个实际上只是缩放背景图像)。

http://www.dillerdesign.com/experiment/DD_belatedPNG/

http://www.dillerdesign.com/experiment/DD_belatedPNG/

It's so great. Just drop it in and forget its there. Have yet to see it explode a set of CSS.

太棒了 只需将其放入并忘记它在那里。还没有看到它爆出一套CSS。