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