댓글 검색 목록

[jQuery] jQuery animation queue 예...

페이지 정보

작성자 운영자 작성일 15-06-12 00:18 조회 3,545 댓글 0

<html>

<head>

<script

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

<script type="text/javascript">

  $(document).ready(function() {

 

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

      $("div").show("slow");

      $("div").animate({

        left : '+=20'

      }, 2000);

      $("div").queue(function() {

        $(this).addClass("newcolor");

        $(this).dequeue();

      });

      $("div").animate({

        left : '-=20'

      }, 500);

 

      $("div").slideUp();

    });

  });

</script>

<style>

div {

  margin: 3px;

  width: 50px;

  position: absolute;

  height: 50px;

  left: 10px;

  top: 30px;

  background-color: yellow;

}

 

div.red {

  background-color: red;

}

</style>

</head>

<body>

  Click here...

  <div>365ok.co.kr</div>

</body>

</html> 

댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.