15jQuery Learning Notes-----Animation----layer display and hiding

Source: Internet
Author: User

The show (), Hide () method displays and hides elements. Toggle between display and hide using the toggle () method
$ (": Button[value=show]"). Click (function () {$ ("div"). Show ();}); $ (": Button[value=hide]"). Click (function () {$ ("div"). Hide ();});
If the show, hide method is immediately displayed without parameters, and immediately hidden, if the specified speed parameter will be displayed dynamically and hidden at the specified time,
In milliseconds, you can also use three built-in speeds: fast (200 milliseconds), normal (400 milliseconds), slow (600 milliseconds),
This three value can generally be used in the jquery animation function where speed is required.

12<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>3<title></title>4<script src= "Jquery-1.8.3.js" ></script>5<script type= "Text/javascript" >6$(function () {7             //Hidden8$ (' #btnHide '). Click (function () {9$ (' div '). Hide (500);Ten             }); One             //Show A$ (' #btnShow '). Click (function () { -$ (' div '). Show (800); -             }); the             //Show and hide the same key -$ (' #btnToggle '). Click (function () { -$ (' div '). Toggle (' slow ')); -             }); +  -  +         }); A</script> at -<body> -<input id= "btnshow" type= "button" name= "name" value= "Display layer"/> -<input id= "btnhide" type= "button" name= "name" value= "hidden layer"/> -<input id= "Btntoggle" type= "button" name= "name" value= "Show/Hide Layer"/> -<div style= "Height:200px;width:300px;background-color:blue" > in  -</div> to</body> +

15jQuery Learning Notes-----Animation----layer display and hiding

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.