简体   繁体   English

字体真棒微调按钮在Firefox中不起作用

[英]font awesome spinner in button not working in firefox

I am trying to use a font awesome spinner icon in a button but it doesn't seem to work in the Firefox browser. 我正在尝试在按钮中使用超棒的字体微调器图标,但在Firefox浏览器中似乎无法使用。 It does however work in the chrome browser. 但是,它确实可以在chrome浏览器中使用。

Interesting thing is the font awesome spinner seems to work standalone outside the button but not inside the button. 有趣的是,超棒的字体似乎可以在按钮外独立运行,但不能在按钮内独立运行。

Here is my fiddle for you to test with http://jsfiddle.net/ngLqoqyo/ 这是我的提琴供您使用http://jsfiddle.net/ngLqoqyo/进行测试

I am thinking maybe compatible css but unable to find something up to now. 我在想兼容的CSS,但到目前为止找不到任何东西。

Here is the CSS im applying: 这是CSS im正在应用:

.load-animate {
    -animation: spin .7s infinite linear;
    -webkit-animation: spin2 .7s infinite linear;
}

@-webkit-keyframes spin2 {
    from { -webkit-transform: rotate(0deg);}
    to { -webkit-transform: rotate(360deg);}
}

@keyframes spin {
    from { transform: scale(1) rotate(0deg);}
    to { transform: scale(1) rotate(360deg);}
}

You can also use the -moz-animation property. 您也可以使用-moz-animation属性。 See updated code here: http://jsfiddle.net/ngLqoqyo/1/ 在此处查看更新的代码: http : //jsfiddle.net/ngLqoqyo/1/

There is a stray dash in your code. 您的代码中有一个破折号。

Also, you don't need different animation names for each browser. 同样,您不需要为每个浏览器使用不同的动画名称。 You can define the same animation under the same name with the different browser prefixes and reference them in the following way: 您可以使用不同的浏览器前缀定义相同名称的相同动画,并通过以下方式引用它们:

.load-animate {
    -webkit-animation: spin .7s infinite linear;
    animation: spin .7s infinite linear;
}

@-webkit-keyframes spin {
    from { -webkit-transform: rotate(0deg);}
    to { -webkit-transform: rotate(360deg);}
}

@keyframes spin {
    from { transform: rotate(0deg);}
    to { transform: rotate(360deg);}
}

Also, remember to always put prefixed properties before the last, unprefixed version of the property (in this case the order in .load-animate ) 另外,请记住始终将前缀属性放在属性的最后一个无前缀版本之前(在这种情况下, .load-animate的顺序)

You have a typo which is causing the problem. 您有错字导致问题。

.load-animate {
    -animation: spin .7s infinite linear;
    -webkit-animation: spin2 .7s infinite linear;
}

should be 应该

.load-animate {
    animation: spin .7s infinite linear; /* no starting dash */
    -webkit-animation: spin2 .7s infinite linear;
}

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

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