$(function () {
toggle=1;
function bounce(){
if(toggle == 1){
$(".ball").animate({top:'-=80px'}, 1000);
toggle = 0;
}else{
$(".ball").animate({top:'+=80px'},1000);
toggle = 1;
}
}
setInterval(bounce, 800);
});
Live Demo
Labels
- bootstrap (1)
- css (4)
- jquery (16)
- Live Demo (14)
- Others (2)
- PHP (4)
- prestashop 1.6 (7)
- Topic - Advance (7)
- Topic - basic (27)
- Topic - Semi Advance (16)
- wordpress (6)
- wordpress plugins (1)
- YII (14)
Wednesday, October 8, 2014
Bouncing ball using jquery every seconds
Create a bouncing ball using jquery. The div moves up after 1 second and move down after.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment