search

Home  >  Q&A  >  body text

javascript - How to implement the like function of mobile qq?

How to achieve the animation of numbers flying after likes?

漂亮男人漂亮男人2738 days ago568

reply all(3)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-19 10:18:38

    I originally wanted to post the code, but it’s a bit long and troublesome

    My cooking is to give the number that pops up and gets bigger to a p

    Then add animation style to this p

    It’s a bit troublesome to extract the js file. Let me show you my css
    `
    /Like/
    @-webkit-keyframes niceIn {

    0% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: 1;
        -webkit-transform: scale(1.5);
        transform: scale(1.5)
    }
    70% {
        -webkit-transform: scale(.8);
        transform: scale(.8)
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1)
    }

    }
    @keyframes niceIn {

    0% {
        opacity: 1;
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: 1;
        -webkit-transform: scale(1.5);
        -ms-transform: scale(1.5);
        transform: scale(1.5)
    }
    70% {
        -webkit-transform: scale(.8);
        -ms-transform: scale(.8);
        transform: scale(.8)
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1)
    }

    }

    @-o-keyframes niceIn{

    0% {
        opacity: 1;
        -o-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: 1;
        -o-transform: scale(1.5);
        transform: scale(1.5)
    }
    70% {
        -o-transform: scale(.8);
        transform: scale(.8)
    }
    100% {
        opacity: 1;
        -o-transform: scale(1);
        transform: scale(1)
    }

    }

    @-moz-keyframes niceIn{

    0% {
        opacity: 1;
        -moz-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: 1;
        -moz-transform: scale(1.5);
        transform:scale(1.5)
    }
    70% {
        -o-transform: scale(.8);
        transform: scale(.8)
    }
    100% {
        opacity: 1;
        -moz-transform: scale(1);
        transform: scale(1)
    }

    }
    .niceIn {

    -webkit-animation:niceIn 0.8s .2s ease;
    -moz-animation:niceIn 0.8s .2s ease;
    -o-animation:niceIn 0.8s .2s ease;
    animation:niceIn 0.8s .2s ease;

    }
    `

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-19 10:18:38

    Write the animation style, click to switch the class of this style when finished

    reply
    0
  • 阿神

    阿神2017-05-19 10:18:38

    Click to trigger animation. Animation can be realized using CSS3 animation

    reply
    0
  • Cancelreply