수

jQuery.dequeue()

· 2017-11-25 (토) 23:45:40 · 2753

jQuery.dequeue()

 

설명 : 일치하는 요소의 대기열에서 다음 함수를 실행합니다.

참고 : 이 방법은 낮은 수준의 방법이므로 .dequeue()대신 사용해야 합니다.

When jQuery.dequeue()가 호출 되면 큐의 다음 함수가 큐에서 제거 된 다음 실행됩니다. 이 함수는 순서대로 (직접 또는 간접적으로) jQuery.dequeue()호출되도록해야하므로 시퀀스를 계속 진행할 수 있습니다.

예:
jQuery.dequeue ()를 사용하여 대기열이 계속 이동하도록하는 사용자 정의 대기열 기능을 종료하십시오.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery.dequeue demo</title>
  <style>
  div {
    margin: 3px;
    width: 50px;
    position: absolute;
    height: 50px;
    left: 10px;
    top: 30px;
    background-color: yellow;
  }
  div.red {
    background-color: red;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<button>Start</button>
<div></div>
 
<script>
$( "button" ).click(function() {
  $( "div" )
    .animate({ left: '+=200px' }, 2000 )
    .animate({ top: '0px' }, 600 )
    .queue(function() {
      $( this ).toggleClass( "red" );
      $.dequeue( this );
    })
    .animate({ left:'10px', top:'30px' }, 700 );
});
</script>
 
</body>
</html>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
jQuery 18-01-25 조회 4,564
JavaScript 18-01-24 조회 8,598
기타 18-01-24 조회 2,839
웹서버 18-01-24 조회 3,096
기타 18-01-22 조회 7,904
기타 18-01-22 조회 5,806
웹서버 18-01-18 조회 6,922
PHP 18-01-12 조회 6,419
jQuery 18-01-10 조회 3,936
jQuery 18-01-10 조회 2,810
jQuery 18-01-10 조회 3,475
MySQL 18-01-08 조회 3,642
jQuery 18-01-08 조회 2,967
jQuery 18-01-08 조회 3,190
jQuery 18-01-08 조회 4,903
PHP 18-01-05 조회 4,840
jQuery 18-01-04 조회 4,643
jQuery 18-01-04 조회 3,264
jQuery 18-01-04 조회 2,722
jQuery 17-12-06 조회 2,908
jQuery 17-12-06 조회 3,676
jQuery 17-12-06 조회 3,496
jQuery 17-12-04 조회 2,886
jQuery 17-12-04 조회 2,119
jQuery 17-12-04 조회 3,079
jQuery 17-12-04 조회 2,944
jQuery 17-11-25 조회 2,754
jQuery 17-11-25 조회 2,699
jQuery 17-11-25 조회 2,374
jQuery 17-11-24 조회 2,450