Maleka Maleka - 1 year ago 92
jQuery Question

How to set animated icons to stop after some time

I have the following code to be displayed following an event:

$("span[name|='ttimer'").html("<i class='fa fa-refresh fa-spin fa-5x' aria-hidden='true'></i> ");


How would it be possible to let the spinning motion last for example 3 seconds then stop moving?

Answer Source

Maybe you are looking for this, animation-iteration-count

div {
    animation-iteration-count:3;
    -webkit-animation-iteration-count:3; /* Safari 和 Chrome */
}

this way let you do not have to remove the classname

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download