How can I create a “Please Wait, Loading…” animation using jQuery?

后端 未结 17 1969
长情又很酷
长情又很酷 2020-11-22 00:07

I would like to place a \"please wait, loading\" spinning circle animation on my site. How should I accomplish this using jQuery?

17条回答
  •  爱一瞬间的悲伤
    2020-11-22 00:39

    I use CSS3 for animation

    /************ CSS3 *************/
    .icon-spin {
      font-size: 1.5em;
      display: inline-block;
      animation: spin1 2s infinite linear;
    }
    
    @keyframes spin1{
        0%{transform:rotate(0deg)}
        100%{transform:rotate(359deg)}
    }
    
    /************** CSS3 cross-platform ******************/
    
    .icon-spin-cross-platform {
      font-size: 1.5em;
      display: inline-block;
      -moz-animation: spin 2s infinite linear;
      -o-animation: spin 2s infinite linear;
      -webkit-animation: spin 2s infinite linear;
      animation: spin2 2s infinite linear;
    }
    
    @keyframes spin2{
        0%{transform:rotate(0deg)}
        100%{transform:rotate(359deg)}
    }
    @-moz-keyframes spin2{
        0%{-moz-transform:rotate(0deg)}
        100%{-moz-transform:rotate(359deg)}
    }
    @-webkit-keyframes spin2{
        0%{-webkit-transform:rotate(0deg)}
        100%{-webkit-transform:rotate(359deg)}
    }
    @-o-keyframes spin2{
        0%{-o-transform:rotate(0deg)}
        100%{-o-transform:rotate(359deg)}
    }
    @-ms-keyframes spin2{
        0%{-ms-transform:rotate(0deg)}
        100%{-ms-transform:rotate(359deg)}
    }
    
    
    
    
    Default CSS3
    Cross-Platform CSS3

提交回复
热议问题