简体   繁体   English

IE过滤器抗锯齿问题

[英]IE Filter Antialiasing problem

So i have a page with a bunch of images. 所以我的页面上有一堆图像。 And I have a function which fades out these layers using IE's opacity filter through javascript. 我有一个功能,可通过javascript使用IE的不透明度过滤器淡出这些图层。

Now when i fade in these elements. 现在,当我淡出这些元素时。 I have to set the particular element (which has the opacity filter applied to it) with a background image or a background color (to prevent anti-aliasing of clear type fonts, read this for more http://www.jonathancross.com/projects/Ugly_font_anti-aliasing_problem_in_Internet_Explorer_6_7_and_8.html ). 我必须使用背景图片或背景色(以防止透明字体的抗锯齿)设置特定的元素(已应用不透明度滤镜),以了解更多信息。http://www.jonathancross.com/ projects / Ugly_font_anti-aliasing_problem_in_Internet_Explorer_6_7_and_8.html )。

Now my questions are: 现在我的问题是:

  1. For a group of elements is there any better solution than a case structure for setting the background-image/background-color for each element? 对于一组元素,是否有比案例结构更好的解决方案来为每个元素设置背景图像/背景色?
  2. Some text-boxes are not seen properly and appear to merge with the overall background image set (The background layer consists of a 1x1 px image which is repeated where ever necessary) 某些文本框未正确显示,似乎与整个背景图像集合并(背景层由1x1 px图像组成,在必要时会重复)

Thanks in advance! 提前致谢!

There is a trick I have used... if the background behind the text is such that you can pick a solid color that will match it within a reasonable degree, you can use the following pair of CSS rules to do faux-antialiasing on the text, in IE only: 我使用了一个技巧...如果文本后面的背景足以使您可以选择在合理范围内与之匹配的纯色,则可以使用以下CSS规则对文字,仅在IE中:

background-color: #CCCCCC; 背景颜色:#CCCCCC; / pick the color that matches your background / filter:progid:DXImageTransform.Microsoft.Chroma(color='#CCCCCC'); / 选择与您的背景相匹配的颜色 /滤镜:progid:DXImageTransform.Microsoft.Chroma(color ='#CCCCCC'); / use the same color here / / 在这里使用相同的颜色 /

  1. You have to define the background on each element, there's no getting round that as far as I am aware. 您必须在每个元素上定义背景,据我所知,这没有什么回合。 You could do this with css, something like 您可以使用css来完成此操作,例如

    .mydiv p {background:#fff} .mydiv p {background:#fff}

  2. Using 1x1 px background causes repeating issues. 使用1x1 px背景会导致重复问题。 Using 2x2 px does not. 不使用2x2 px。

I "got around" this by disabling Anti-Aliasing in IE completely by appending an Opacity filter of 1.0 on every element on the page... 我通过在页面上的每个元素上附加1.0的不透明度过滤器来完全禁用IE中的抗锯齿功能来“解决”此问题。

Ok, so it looks nasty - but at least everything looks like (and IE6/7 is nasty anyway ^_^). 好的,所以看起来很讨厌-但至少一切看起来都像(IE6 / 7还是很讨厌^ _ ^)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM