.slideDown( [duration,] [callback] ) .slideDown( [duration,] [easing,] [callback] )
<html> <head> <title>ThaiCreate.Com jQuery Tutorials</title> <style> div { background:#de9a44; margin:3px; width:80px; height:40px; display:none; float:left; } </style> <script type="text/javascript" src="jquery-1.6.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(document.body).click(function () { if ($("div:first").is(":hidden")) { $("div").slideDown("slow"); } else { $("div").hide(); } }); }); </script> </head> <body> Click me! <div></div> <div></div> <div></div> </body> </html>
<html> <head> <title>ThaiCreate.Com jQuery Tutorials</title> <style> div { background:#cfd; margin:3px; width:50px; text-align:center; float:left; cursor:pointer; border:2px outset black; font-weight:bolder; } input { display:none; width:120px; float:left; margin:10px; } </style> <script type="text/javascript" src="jquery-1.6.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("div").click(function () { $(this).css({ borderStyle:"inset", cursor:"wait" }); $("input").slideDown(1000,function(){ $(this).css("border", "2px red inset") .filter(".middle") .css("background", "yellow") .focus(); $("div").css("visibility", "hidden"); }); }); }); </script> </head> <body> <div>Push!</div> <input type="text" /> <input type="text" class="middle" /> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท