I use a js function that moves a background image and i want to stop this moving after a time.I tried to use setTimeout() and clearTimeout() methods, but it doesn't stop the movement.What is the problem?
<script type="text/javascript" language="javascript"> function MoveBg(){some code} $(function() { var i = setTimeout("MoveBg()" ,200);setTimeout(function(){clearTimeout(i)},10000); }); </script>