I'm looking for a solution to smoothly remove the fa-spin
class from an element once a process is finished.
The issue I'm facing is that there is no smooth transition between the icon spinning and stopping.
setTimeout(function() {
stopSpinner();
}, 2500);
function stopSpinner() {
$('i').removeClass('fa-spin');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<i class="fa fa-lg fa-refresh fa-spin"></i>
Is there a way to incorporate a smooth transition so that the change from spinning to non-spinning icon is more fluid?