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 |