Open vweyl opened 11 years ago
Hi Vincent,
You can use the following css class to animate a dom element. In this example, my spinner icon is a web font and has the class .fs1
:
.fs1 {
display: inline-block;
font-size:4em;
height: 1em;
line-height: 1;
}
.spinner {
-webkit-animation: myRotate 1s linear infinite;
}
@-webkit-keyframes myRotate {
from {
-webkit-transform:rotate(0);
}
to {
-webkit-transform:rotate(360deg);
}
}
You could create a simple Olives plugin object as below:
define("Spinner.plugin", [], function(){
return function SpinnerConstructor(){
var node = null,
/* default class name */
className = "spinner";
this.anim = function(dom, name){
node = dom;
className = name;
};
this.start = function(){
node.classList.add(className);
};
this.stop = function(){
node.classList.remove(className);
};
};
});
Hi Olivier,
Right now I have opted for spin.js and it seems to be working pretty well. Your solution could be a nice enhancement.
In both public and library idea list views