div从上到下展现 隐藏
作者:互联网
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>显示和隐藏DIV</title> <script src="js/jquery-1.10.2.js"></script> <style type="text/css"> </style> <script type="text/javascript"> $(document).ready(function () { $("#gg").click(function () { if ($("#gg").text() == "展开") { $("#gg").text("收起"); $("#mm").slideDown("fast"); } else if ($("#gg").text() == "收起") { $("#gg").text("展开"); $("#mm").slideUp("fast"); } else { alert("Error!"); } }) }) </script> </head> <body> <form id="form1" runat="server"> <div> <span><a id="gg" href="Javascript:void(0)">展开</a></span> <div id="mm" style="border: 1px solid pink;width: 300px;height: 400px;"> <p>妹妹你坐船头欧哦</p> <p>哥哥我岸上走</p> <p>恩恩爱爱</p> <p>纤绳荡悠悠</p> </div> </div> </form> </body> </html>
jquery常用隐藏方法
$(document.getElementById("gengdu")).show(500);显示 $(document.getElementById("gengdu")).hide(500);隐藏
标签:text,展现,fast,gg,div,document,隐藏,500,从上到下 来源: https://www.cnblogs.com/huasshuai/p/15509795.html