从外部加载时jQuery淡入IE Png问题 [英] jQuery fadeIn IE Png Issue when loading from external

查看:108
本文介绍了从外部加载时jQuery淡入IE Png问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery中的加载内容方法将我域中的外部html文件中的数据加载到我的网页上的div中。我把div从新页面中删除,同时将div隐藏在当前页面中,将其淡出并淡出新的。在这两个div中都有一个png图像,它在IE中创建可怕的黑色斑点,工作正常在其他浏览器中但是由于IE无法处理多个过滤器而导致混乱。

I am loading data from external html files within my domain into a div on my webpage using a load content method in jQuery. I take the div out of the new page whilst hiding the div in the current page by fading this out and fading the new one in. There is a png image in both of these divs and it is creating horrid black blobs in IE, works fine in other browsers but due to IEs inability to process multiple filters its making a mess.

我尝试使用单元png修复无效,是否有人有任何修复或想法在这个过渡期间帮助让我的朋友看起来很漂亮?

I tried using the unit png fix to no avail, does anyone have any fixes or ideas to help keep my pngs looking nice during this transition?

i46.tinypic.com/t9dtvr.jpg这是问题的截图,干杯

i46.tinypic.com/t9dtvr.jpg this is a screenshot of the problem, cheers

还发现原始页面上的png(在加载任何新内容之前)使用单元png修复完美地淡入和淡出但是从外部文件中加载然后退出的东西并不是。我已经将修复程序添加到这些页面,但这也不起作用。

also discovered that the png that is on the page originaly (before loading anything new) fades in and out perfectly using the unit png fix but stuff loading in and then back out from external files doesnt. Ive added the fix to those pages too but that doesnt work either.

推荐答案

此问题没有100%的解决方案。如果您有PNG的半透明区域,则应用的任何滤镜都会使这些区域完全不透明。我见过的大多数渐变过渡在淡入淡出过程中应用过滤器,然后删除过滤器。这意味着您会在图像淡入时看到别名区域但在转换结束时看起来会很好。

There isn't any 100% solution to the problem. If you have semi transparent areas of a PNG, any filters applied will render those areas fully opaque. Most fading transitions I've seen apply the filter during the fade, then remove the filter afterwards. This means you will see the aliased areas while the image fades in but it will look fine at the end of the transition.

另一个解决方案可用于页面的某些部分静态:如果图像背后的背景是静态的,您可以从该背景创建图像并将其用作img标记的背景图像。然后,淡入和淡出将工作得很好。如果png图像已经是元素的背景图像,则需要将其放在具有不透明背景图像集的容器中,然后淡化它。

Another solution can be used for parts of a page that are static: If the background behind the image is static you can create an image from that background and use it as the background image of your img tag. Then, fading in and out will work just fine. If the png image is already the background image of an element, you will need to put it in a container with the opaque background image set and fade that instead.

如果你在文字或动态内容面前消失,你可以做的并不多。

If you're fading in front of text or dynamic content, there's not much you can do.

编辑:以下页面似乎有一个涉及旧AlphaImageLoader过滤器和带有不透明度过滤器集的父div的解决方案:

The following page seems to have a solution involving the old AlphaImageLoader filter and a parent div with the opacity filter set:

http://blog.mediaandme.be/?ref=17

这篇关于从外部加载时jQuery淡入IE Png问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆