I have the following code in http://jsfiddle.net/4LPSD/
It works in Chrome(version 35.0.1916.153), but not in Firefox(version 30.0).
/******** HTM **********************/
<div class="container">
<h3>Animated button</h3>
<button class="btn btn-lg btn-warning"><span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> Loading...</button>
</div>
/******* CSS **********************/
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
@import url('http://getbootstrap.com/dist/css/bootstrap.css');
.glyphicon-refresh-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);}
}
Anybody knows whats wrong?
I'm trying to rotate a picture icon.
You need to include the Mozilla prefix, and remove the hyphen before animation
:
.glyphicon-refresh-animate {
animation: spin .7s infinite linear;
-webkit-animation: spin2 .7s infinite linear;
-moz-animation: spin2 .7s infinite linear;
}
@-moz-keyframes spin2 {
from { -moz-transform: rotate(0deg);}
to { -moz-transform: rotate(360deg);}
}
Thanks for your answers.
I use the parameter -moz and remove the caracter "-" of -animation
This is final code:
/*********** HTML *********************/
<div class="container">
<h3>Animated button</h3>
<button class="btn btn-lg btn-warning">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
Loading...
</button>
</div>
/*********** CSS *********************/
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
@import url('http://getbootstrap.com/dist/css/bootstrap.css');
.glyphicon-refresh-animate {
-moz-animation: spin-moz .7s infinite linear;
-webkit-animation: spin-webkit .7s infinite linear;
animation: spin .7s infinite linear;
}
@-moz-keyframes spin-moz {
from { -moz-transform: rotate(0deg);}
to { -moz-transform: rotate(360deg);}
}
@-webkit-keyframes spin-webkit {
from { -webkit-transform: rotate(0deg);}
to { -webkit-transform: rotate(360deg);}
}
@keyframes spin {
from { transform: scale(1) rotate(0deg);}
to { transform: scale(1) rotate(360deg);}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With