jquery anim test 1

jquery animation test

HTML

<div id="box"></div>

CSS

#box {position:absolute; left:10px; bottom: 0; width: 30px; background-color:red; }

JavaScript

jQuery('#box').animate({
    height: '300px'
},1000,'linear', function(){
    jQuery('#box').animate({
        bottom: '50px'
    },2000,'linear', function(){
        bounce();
    });
});


function bounce(){
    jQuery('#box').animate({
        bottom: '0'
    },2000,'linear', function(){
        jQuery('#box').animate({
            bottom: '50px'
        },2000,'linear',function(){
            bounce();
        });
    });
}