Demo of Jquery bounce UI effects


Bounce 500ms will end with callback function to show alert window.

Refresh this page

Direction




Distance : default 20
Apply Bounce effects by clicking the buttons





CSS


<style>
.msg{ 
position: absolute;
FONT-SIZE: 12px;
font-family: Verdana;
padding:10px;
width:350px;
height: 100px;
background-color: #f1f1f1;
}
</style>

HTML


<input type=button id=b1 value='Bounce 5000ms'>
<input type=button id=b2 value='Bounce fast'>
<input type=button id=b3 value='Bounce slow'>
<input type=button id=b4 value='Bounce Default'>
<input type=button id=b5 value='Bounce Right'>
<input type=button id=b6 value='Bounce Left'>
<input type=button id=b7 value='Bounce Up'>
<input type=button id=b8 value='Bounce Down'>

jquery


<script>
$(document).ready(function() {
$('#b1').click(function(){
$( "#d1" ).effect( "bounce",{times:10,distance:200},5000,function(){
alert('This alert is created by using callback function once the effect is over');
} );
})
/////////
////////////////////
$('#b2').click(function(){
$( "#d1" ).effect( "bounce",{times:4,distance:200},'fast' );
})

$('#b3').click(function(){
$( "#d1" ).effect( "bounce",{times:3,distance:200},'slow' );
})

$('#b4').click(function(){
$( "#d1" ).effect( "bounce");
})
////////////////////
$('#b5').click(function(){
$( "#d1" ).effect( "bounce",{direction: 'right',times:2});
})

$('#b6').click(function(){
$( "#d1" ).effect( "bounce",{direction: 'left',times:2});
})

$('#b7').click(function(){
$( "#d1" ).effect( "bounce",{direction: 'up',times:2});
})

$('#b8').click(function(){
$( "#d1" ).effect( "bounce",{direction: 'down',times:2});
})
$('#b9').click(function(){
$( "#d1" ).effect( "bounce",{distance: 5,times:2});
})

$('#b10').click(function(){
$( "#d1" ).effect( "bounce",{distance: 200,times:2});

})



})
</script>