Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery Animate - Queue True</title> <style> body { font-family: Arial, sans-serif; padding: 20px; } .box { width: 100px; height: 100px; background-color: #2196f3; margin-top: 20px; opacity: 0.8; } button { padding: 10px 20px; background-color: #333; color: white; border: none; border-radius: 5px; cursor: pointer; } </style> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <h3>Queue: true (Default Behavior)</h3> <p>This example demonstrates how animations are queued and executed sequentially. We explicitly set <code>queue: true</code> in one step (note: it is the default).</p> <button>Start Animation</button> <div class="box"></div> <script> $(document).ready(function () { $("button").click(function () { var div = $(".box"); div.animate({ height: '300px', opacity: 0.4 }, "slow"); div.animate({ width: '400px', opacity: 0.8 }, { duration: "slow", queue: true }); // queue:true (default) div.animate({ height: '100px', opacity: 0.4 }, "slow"); div.animate({ width: '100px', opacity: 0.8 }, "slow"); }); }); </script> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console