PDA

View Full Version : Free JavaSccript codes



JavaScriptBank
11-09-2010, 08:54 PM
Helpful JavaScript for Web development

Amazing Bounce Effect using jQuery framework

JavaScript bounce effect is the type of script presented on jsB@nk.com through many plained-JavaScript example codes, such as:

- J... detail (http://www.javascriptbank.com/elastic-trail-script.html) at JavaScriptBank.com - 2.000+ free JavaScript codes (http://www.javascriptbank.com/)


http://www.javascriptbank.com/javascript.images/framework/amazing-bounce-effect-using-jquery-framework.jpg (http://www.javascriptbank.com/javascript/framework/jquery/amazing-bounce-effect-using-jquery-framework/preview/en/)
Demo: JavaScript Amazing Bounce Effect using jQuery framework (http://www.javascriptbank.com/amazing-bounce-effect-using-jquery-framework.html/en/)


[U]How to setup

Step 1: Use CSS code below for styling the script
CSS

<STYLE type="text/css">
body, input{
font-family: Calibri, Arial;
}
div {
padding:5px;
width:150px;
height:100px;
text-align:center;
}
#bouncy1 {
background-color:#FFEE88;
}
#bouncy2 {
background-color:#EE88FF;
}
#bouncy3 {
background-color:#EE8888;
}
#bouncy4 {
background-color:#88EEFF;
}
</STYLE>

Step 2: Copy & Paste JavaScript code below in your HEAD section
JavaScript

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<SCRIPT>
$(function(){

//Add bounce effect on Click of the DIV
$('#bouncy1').click(function () {
$(this).effect("bounce", { times:5 }, 300);
});

$('#bouncy2').click(function () {
$(this).effect("bounce", { direction:'left', times:5 }, 300);
});

$('#bouncy3').click(function () {
$(this).effect("bounce", { direction:'right', times:5 }, 300);
});

$('#bouncy4').click(function () {
$(this).effect("bounce", { direction:'down', times:5 }, 300);
});

//Bounce all DIVs on click of button
$("#bounceAll").click(function(){
$("div").click();
});
});
</SCRIPT>

Step 3: Copy & Paste HTML code below in your BODY section
HTML

<table>
<tr>
<td><div id="bouncy1">Click here to bounce. Direction: Up</div></td>
<td><div id="bouncy2">Click here to bounce. Direction: Left</div></td>
</tr>
<tr>
<td><div id="bouncy3">Click here to bounce. Direction: Right</div></td>
<td><div id="bouncy4">Click here to bounce. Direction: Down</div></td>

</tr>
</table>

<br/>
<input id="bounceAll" type="button" value="Click to Bounce All!"/>







JavaScript Countdown Timer (http://www.javascriptbank.com/javascript-countdown-timer.html/en/) - JavaScript Web based Music Player (http://www.javascriptbank.com/web-based-music-player.html) - Free JavaScript Codes (http://www.javascriptbank.com/)


The Site may provide, or third parties may provide, links to non-JavaScriptBank.com Internet World Wide Web sites or resources. Because JavaScriptBank.com has no control over such sites and resources, you acknowledge and agree that JavaScriptBank.com is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that JavaScriptBank.com shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.