분류 jQuery

jQuery animation move 예...

컨텐츠 정보

  • 조회 811 (작성일 )

본문

<!DOCTYPE html>

<html>

<head>

<style type="text/css">

div {

  position: relative;

  left: 0;

  top: 0;

  width: 10px;

  height: 10px;

  background-color: blue;

}

</style>

<script

  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script type="text/javascript">

  $(function() {

    $(document).click(function(event) {

      $("div#box").animate({

        left : '+=100px'

      }, 200);

    });

  });

</script>

</head>

<body>

  <div id="box"></div>

</body>

</html>