javascript - Example with .queue() & .dequeue() to do with $.queue() & $.dequeue() -


i have done animation using animate(), queue(), , dequeue(). have read jquery has - jquery.queue() or $.queue() , jquery.dequeue() or $.dequeue(). can me these new terms of example, making changes , using - $.queue() , $.dequeue() ? ...

<html>  <head>     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> </head>  <body>     <button id=but1>click</button>     <div id=div1 style="width:50px;height:50px;position:relative;background:pink;">hi</div>     <script>         $(document).ready(function() {             $('#but1').click(function() {                 $('#div1')                     .animate({                         left: "+=300px"                     }, 3000)                     .queue(function() {                         $(this).html("hello")                             .css('background', 'red')                             .css('width', '400px')                             .dequeue();                     })                     .animate({                         top: "+=500px"                     }, 1000)             });         });     </script> </body>  </html> 

queue , dequeue operates on selector. function doesn't need html element work $. $.ajax()


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -