javascript - How to implement the like function of mobile qq?
漂亮男人
漂亮男人 2017-05-19 10:16:38
0
3
565

How to achieve the animation of numbers flying after likes?

漂亮男人
漂亮男人

reply all(3)
过去多啦不再A梦

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;

}
`

我想大声告诉你

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

阿神

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template