RedPacketRain

This is an H5 red envelope grab small game

The function is relatively simple, without relying on any third party library, pure native JS writing

Project Address:RedPacketRain

Page screenshots

Click on the link to view it in Chrome Phone Emulator mode.

Import using script tag

<script type="text/javascript" src="./js/rain.min.js"></script>
<script type="text/javascript" src="./js/rainPage.min.js"></script>
Copy the code

Scan the code on your phone to see the effect

The main method

Methods Options
rain.create() Id, amount
rain.start() Data (Data returned by Ajax requests)
rain.stop() Don’t need to transfer the cords
rain.move() Rains
rain.clear() Don’t need to transfer the cords
rain.ajax() Similar to $.ajax in jQuery

The last

You can download the code to local run, if you think it is ok, give a Star, the first time to Denver to write an article, if there are mistakes and bad places please correct, so THAT I can continue to progress! I have to go to work tomorrow