I am new to Jquery.. I want use bounce effect in my application..I have seen a sample code here.It works there,But when copied and saved in my system its not working. Its giving JS error: Object does not support method / property ‘effect’.
Any ideas?
Here is my code,
<!DOCTYPE>
<html>
<head>
<title>Bounce Effect</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#button").click(function(){
$("#Target").effect( "bounce", {times:3}, 300 );
});
});
</script>
<style>
p {
background-color:#bca;
width:200px;
border:1px solid green;
}
div{ width:100px;
height:100px;
background:red;
}
</style>
</head>
<body>
<p>Click the button</p>
<button id="button"> Bounce </button>
<div id="Target" class="target" >
</div>
</body>
</html>
You need the proper library to use those effects.
In the example you provided there’s a link to JQuery UI, which I believe have the “bounce” effect and
.effectfunction.So, after switching out his custom JQuery UI to the one on Google, try this
You can learn more about it here.
JQuery and JQuery UI have fairly extensive documentation, so you should read up on them.
Also, here’s a JSFiddle for you to… fiddle around with.
It’s useful when you want to make examples or test something fast.