Fork me on GitHub

[H5]-直播点赞飞出特效

直播页面点赞特效飞出效果:

image

1
2
3
4
5
6
7
8
9
10
11
12
13
$('.onlike').on('click', function() {
var colors = ['#ffc510', '#ff4a4a', '#ff9141', '#fb7c63', '#05e0e8', '#24ec79', '#50b7ff', '#b9f110', '#59e4b5', '#fe76e9', '#b976fe', '#fea2d0', '#918eff'],
cindex = Math.floor(Math.random() * 12);
var icons = ['icon-aixin1', 'icon-gouwudai', 'icon-yifuicon122438', 'icon-juzi', 'icon-liwu', 'icon-aixin', 'icon-flower1', 'icon-shuiguo', 'icon-kafei'],
iindex = Math.floor(Math.random() * 8);
var x = 200,
y = 400;
var rand = parseInt(Math.random() * (x - y + 1) + y);
$('.g-scrollview').append('<img src="./images/icon_10_cur.png" class="ico-like">');
$(".ico-like").animate({ bottom: "800px", opacity: "0", right: rand, }, 3000, null, function() {
$(this).remove()
})
});
支持作者