【问题标题】:how to fix opacity on IE6如何修复IE6上的不透明度
【发布时间】:2011-04-14 12:59:41
【问题描述】:

如何在 IE6 上修复不透明度

此代码在 IE6 上不起作用!

filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;

还有这段代码!

$('#description').animate({opacity: 0.0}, 1000);

【问题讨论】:

  • IE 6 已经过时了,连google都不再支持了,你也应该支持。
  • @Aviatrix - 你有指向even google have stopd supporting it 的链接吗?
  • @Aviatrix 从技术上讲,只有 YouTube,肯定不包括整个谷歌
  • @reigel ,这里是googleenterprise.blogspot.com/2010/01/… @faressoft ,向这些用户展示他们正在使用过时的浏览器,因此他们可能无法正常查看该网站。并提供其他borwsers、opera、chrome、ff ..的链接。
  • @Aviatrix - 希望谷歌是我唯一的客户;)

标签: jquery html css dom internet-explorer-6


【解决方案1】:

您的样式元素需要have layout 才能使过滤器正确呈现。

试试:

filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
display: inline-block;

或者:

filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
zoom: 1;

【讨论】:

    【解决方案2】:

    如果您在 jQuery 中使用opacity,那么fadeInfaceOutfadeTo 函数应该比animate 更好。在你的情况下,它会是

    $('#description').fadeOut(1000);
    

    或者fadeTo

    $('#description').fadeOut(1000, 0.0);
    

    但它适用于 IE6! :(

    http://jsbin.com/owisa/3

    哪里不行?

    【讨论】:

    • @faressoft - 我认为这个工作正常。哪个部分对你不起作用?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-16
    • 2012-02-11
    • 1970-01-01
    • 2018-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多