Slideup () method usage analysis in jquery _jquery

Source: Internet
Author: User

This example describes the use of the Slideup () method in jquery. Share to everyone for your reference. The specific analysis is as follows:

This method dynamically hides all matching elements by changing the height (decreasing up), and can trigger a callback function when the hide is complete.
The Slideup () method adjusts only the height of the element, allowing the matching elements to be hidden in a "sliding" manner.

I. Grammatical structure:
This method can specify the duration of the animation effect and use the default value normal if there is no specified time. For example:

Copy Code code as follows:
$ ("div"). Slideup (5000)

The above code can set the animation effect to complete within 5000 milliseconds (5 seconds).
This method can also trigger a callback function after the animation completes. For example:
Copy Code code as follows:
("div"). Slideup (5000,function () {alert (' Slide down complete! ')});

The code above can trigger the callback function after the animation completes, and a prompt box pops up.
Two. Instance code:
Copy Code code as follows:

<! DOCTYPE html>
<meta charset= "Utf-8" >
<meta name= "Author" content= "http://www.jb51.net/"/>
<style type= "Text/css" >
div{
Background: #060;
width:300px;
height:300px;
color:red;
}
</style>
<title> Cloud-dwelling community </title>
<script type= "Text/javascript" src= "Mytest/jquery/jquery-1.8.3.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#up"). Click (function () {
$ ("div"). Slideup (5000,function () {alert (' Slide down complete! ')});
})
})
</script>
<body>
<div></div>
<button id= "Up" > Click Up Slide </button>
</body>

In the above code, click on the button, the div will slowly pull up, after completion will pop up a dialog box.

I hope this article will help you with your jquery programming.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.