This time I will share jQuery Plugin and tutorial about Bubble Bounce Animation In JavaScript – jquery.bubble.js, hope it will help you in programming stack.
A small jQuery plugin to simulate a Bubble Machine that randomly generates bubbles with gravity (free fall) and bounce effects on the page.
How to use it:
1. Insert the required JavaScript and CSS files into the page.
1 |
< link rel = "stylesheet" href = "/path/to/css/jquery.bubble.min.css" /> |
2 |
< script src = "/path/to/cdn/jquery.slim.min.js" ></ script > |
3 |
< script src = "/path/to/js/jquery.bubble.min.js" ></ script > |
2. Create a container in which you want to generate bubbles.
1 |
< div id = "example" class = "bubble-wrap" > |
3. Initialize the plugin to start the animation.
4. Override the styles of the bubbles.
01 |
.bubble-wrap .bubbles { |
03 |
-webkit-box-shadow: 0 0 15px 0 rgba( 255 , 255 , 255 , . 3 ) inset ; |
04 |
box-shadow: 0 0 15px 0 rgba( 255 , 255 , 255 , . 3 ) inset ; |
07 |
.bubble-wrap .bubbles:after { |
15 |
background-color : rgba( 255 , 255 , 255 , . 2 ); |
17 |
box-shadow: 0 0 5px 0 rgba( 255 , 255 , 255 , . 3 ); |
5. Initialize the plugin to start the animation.
6. Set the size & ‘blowTime’ range of the bubbles.
7. Set the direction of the bubbles.
8. Set the time interval between bubbles.
9. Stop the animation after x seconds.
10. Customize the CSS classname of the bubbles.
2 |
itemClass: 'J_BubbleItem' |