jquery queue function usage example_jquery
May 16, 2016 pm 04:26 PMThe examples in this article describe the usage of jquery queue function. Share it with everyone for your reference. The specific implementation method is as follows:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.9.1.js"></script>
</head>
<body>
<style>
div { margin:3px; width:40px; height:40px;
position:absolute; left:0px; top:30px;
background:green; display:none; }
div.newcolor { background:blue; }
</style>
Click here...
<div></div>
<script>
$(document.body).click(function () {
$("div").show("slow");
//$("div").slideDown();
$("div").animate({left:' =200'},2000);
$("div").queue(function () {//Queue
$(this).addClass("newcolor");
$(this).dequeue();//Dequeue
});
$("div").animate({left:'-=200'},2000);
$("div").queue(function () {//Queue
$(this).removeClass("newcolor");
$(this).dequeue();//Dequeue
});
$("div").slideUp();
});
</script>
</body>
</html>
I hope this article will be helpful to everyone’s learning of jQuery programming.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Tips for dynamically creating new functions in golang functions

Considerations for parameter order in C++ function naming

How to write efficient and maintainable functions in Java?

Complete collection of excel function formulas

Comparison of the advantages and disadvantages of C++ function default parameters and variable parameters

What are the benefits of C++ functions returning reference types?

What is the difference between custom PHP functions and predefined functions?

Advanced usage of reference parameters and pointer parameters in C++ functions
