This is what I have so far. I want to set a timeout for function spid().
<script type="text/javascript">
$(document).ready(function() {
$("#spid").animate({top: '-110px' }, 600, 'easeOutBounce',
function spid() {
$(this).animate({top:"-=20px"},1000).animate({top:"+=20px"},1000);
setTimeout("spid()",2000);
});
});
There is a problem with
thisin the above code, below code snippet works fineEdit :
please Test the code http://jsbin.com/elaxa3