您可以使用 Jquery toggle() 函数来实现这一点。我已经完成了按钮点击,您可以在链接点击事件中编写相同的内容。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<title>Untitled Page</title>
<script type="text/javascript">
$(document).ready(function() {
$("#link").click(function() {
$('.content').toggle();
return false;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<button id="link" ></button>
<div class="content">
<h2>About</h2>
<p>We are Sydney Wedding Photographers and have ...</p>
</div>
</div>
</form>
</body>
</html>