jquerytwitter-bootstrap

Font Awesome spinners icons not spinning


I have tried to add a Font Awesome spinner icons to a page when I click a button using Jquery, however the spinners does not actually spin.

http://codepen.io/Riggster/pen/WvLZxb

<li id="num1">
  <p>1:
    PHP Code for random number here
  </p>
</li>
<li>
  <p>
    <button class="btn btn-sm btn-default" onclick="NewNum()" type="button">Re-roll random numbers</button>
  </p>
</li>

function NewNum() {
  $("#num1").html("<i class='fa fa-refresh'></i>");
}

Solution

  • adding fa-spin to the class like this will work:

    function NewNum() {
      $("#num1").html("<i class='fa fa-refresh fa-spin'></i>");
    }