Repeat animation in jQuery

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
   setInterval(callMe,2000);
});
function callMe(){
   $("div").animate({left:'250px'}).fadeOut().animate({left:'0'}).fadeIn();
}

</script>
</head>
<body>
  <button>Start</button>
  <br />
  <br />
  <div
    style="background: black; height: 100px; width: 100px; position: absolute;">
  </div>
</body>
</html>

Comments

Popular posts from this blog

Shutdown Computer With Funny Reason

Hidden Attribute in javascript

Draw animated loading spinner canvas in Javascript