【问题标题】:CSS letter-spacing transition does not work in Firefox v26CSS 字母间距转换在 Firefox v26 中不起作用
【发布时间】:2014-02-01 14:42:33
【问题描述】:

此转换适用于 Chrome 和 IE11,但不适用于 Firefox v26 Win7。

MDN specification says it's still in a working draft.

CSS-TRICKS 说它是可动画的,没有任何关于不能在 Firefox 中工作的说明。

This js fiddle demonstrates the behavior.

有什么想法吗?

.trans {   
    -moz-transition: all 1s;
    transition: all 1s    
}

.spaced {    
    letter-spacing: 10px    
}

$("#btn").on('click', function() {
    $("h1").toggleClass("spaced");
});

<h1 class="trans">Animate my letter spacing</h1>
<input type="button" value="animate" id="btn">   

【问题讨论】:

    标签: css firefox transition


    【解决方案1】:

    试试这个,而不是使用 css 你可以 .animate

    http://jsfiddle.net/cornelas/8jAZy/9/

    $("#btn").on('click', function() {
    
       $("h1").animate({ "letter-spacing" : "10px"});
    
    });
    

    这是一种方法,可能还有另一种有效。

    【讨论】:

      【解决方案2】:

      规范中未定义normal(默认值)和长度之间的插值。您想从0 转换为10px,而不是normal 转换为10px

      【讨论】:

      • 我假设默认值为 0。谢谢!
      • 谢谢!一年后这仍然对我有帮助
      猜你喜欢
      • 2015-05-11
      • 1970-01-01
      • 2014-10-07
      • 2013-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多