Home >Web Front-end >Front-end Q&A >What is the usage of jquery queue

What is the usage of jquery queue

藏色散人
藏色散人Original
2021-11-12 10:52:493345browse

The jquery queue method displays the function queue to be executed on the selected element. Its usage syntax is "$(selector).queue(queueName)", and the parameter queueName specifies the name of the queue.

What is the usage of jquery queue

The operating environment of this article: windows7 system, jquery version 3.2.1, DELL G3 computer

What is the usage of jquery queue?

jquery queue() method displays the function queue to be executed on the selected element.

A queue is one or more functions waiting to be run.

queue() method is usually used together with dequeue() method.

An element can have several queues. Most usually have just one, "fx" queue, which is the default jQuery queue.

Syntax

$(selector).queue(queueName)

Parameters

queueName Optional. Specifies the name of the queue.

The default is "fx", the standard effects queue. . j

Example

Add and remove the attribute named "color":

$("button").click(function(){
    var $x = $("div");
    $x.prop("color","FF0000");
    $x.append("The color 属性: " + $x.prop("color"));
    $x.removeProp("color");
});

Recommended learning: "jquery video tutorial"

The above is the detailed content of What is the usage of jquery queue. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Is jquery a language?Next article:Is jquery a language?