(058)jquery_动画_slideToggle
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>animate_slideToggle.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <style type="text/css"> div { margin: 10px 0px; border: solid 1px #ccc; width: 280px; } ul { list-style-type: none; padding: 5px; margin: 0px; display: none; } li { margin: 3px; } h4 { background-color: #eee; padding: 5px; margin: 0px; height: 23px; line-height: 23px; } .fl { float: left; } .fr { float: right; } </style> <script type="text/javascript" src="../js/jquery/jquery190.js"></script> <script type="text/javascript"> $(function(){ $("h4").bind("click",function(){ $("ul").slideToggle(1000,function(){ $("#spnTip").text() == "向下滑"?$("#spnTip").text("向上滑"):$("#spnTip").text("向下滑"); }); }); }); </script> </head> <body> <h3>使用slideToggle()方法切换滑动效果</h3> <div> <h4> <span class="fl">我喜欢吃的水果</span> <span class="fr" id="spnTip">向下滑</span></h4> <ul> <li>苹果</li> <li>甘桔</li> <li>梨</li> </ul> <input id="hidval" type="hidden" value="0"/> </div> </body> </html>
***万事万物都有裂痕,那是光照进来的地方***

浙公网安备 33010602011771号