-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Option Queue
Ryc O'Chet edited this page Feb 1, 2018
·
1 revision
- NOTE: This documentation is for Velocity v2.
In Velocity a queue is a named list of animations that will automatically run in order, so when the first one finishes, the second one will begin etc.
When using more than one queue they will run in parallel with each other, meaning that one queue can be used for something totally independently to another.
You can also set queue to false
to force a new animation call to run in parallel with any currently active animations. This will also run in parallel with other animations added with false
.
The default queue is named ""
- an empty string.
// All of these will start running immediately
element.velocity({ width: "50px" }); // Uses the default "" queue
element.velocity({ height: "50px" }, { queue: "myQueue" }); // Uses the custom "myQueue" queue
element.velocity({ left: "50px" }, { queue: false }); // Will run immediately
element.velocity({ top: "50px" }, { queue: false }); // Will run immediately
// This will run when the previous "myQueue" entry finishes, causing the height to increase and then decrease again
element.velocity({ height: "10px" }, { queue: "myQueue" }); // Uses the custom "myQueue" queue
- Velocity now has totally custom queue code, which is unrelated to jQuery and does not work together with the jQuery queue code.
- Queues will run immediately and automatically. In order to pause a queue please see the
"pause"
command.