.css() does animation

In this chapter you will learn:

  1. CSS animation

CSS animation

<!DOCTYPE html><!--from  ja va 2 s .c  o  m-->
<html>
<head>
<style type="text/css">
div {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 20px;
  height: 20px;
  background-color: green;
}
</style>
<script
  src="http://java2s.com/style/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
  $(function() {

    $(document).click(function() {
      var pos = $("div").css("left");
      pos = parseInt(pos);
      $("div").css("left", pos + 10);
    });
  });
</script>
</head>
<body>
  <div></div>
</body>
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. Syntax and Description for .clearQueue()
Home » jQuery » Effect
.animate()
.css() does animation
.clearQueue()
.delay()
.dequeue()
.extend()
.fadeIn()
.fadeOut()
.fadeTo()
.hide()
.queue()
.show()
.slideDown()
.slideToggle()
.slideUp()
.stop()
.toggle()