• 2019-10-19

    Ajax spinner animation


    Start a discussion

    Sometimes an ajax spinner is need, to indicate that the user need to wait.

    The code below will make the .spinner to spin as soon as the page has been loaded.

    .spinner {
      animation: spin 2s linear infinite;
    @keyframes spin {
      100% {

    For the spinner to do what it is supposed to do, you should probably hide and show this element depending on if an element loads or not.

    Source: https://stackoverflow.com/a/16771693/148496