
Spice Up Your Next Web Demo With Bats
A few years ago, I decided to add a little spice to a web demo that happened to fall on Halloween. Thanks to Eric Grange over at DelphiTools, it was super easy.
I updated Eric’s script slightly, to allow control over when the bats appear (and how many there are). You can include my js file directly, or download here, or clone from the github repo.
See it in action by clicking this:
To make your own bats, follow these steps:
First, include the script in your HTML header or footer. This line uses my host for your convenience, but you can just download the file and use it directly.
<script src="http://static.twomile.com/bats.js"></script>
Then, somewhere in your javascript call makeBats() and give it the number of bats you want to appear. You can start them when the page loads, or as a reward for clicking a certain button. Go nuts.
new BatManager().makeBats(15);
Simple as that. Let me know what fun you have with it, and be sure to thank Eric for the original.
Here is a video of the bats in action: