ITeye博客

Jquery show hide toggle

hsys · 2010-02-01 18:41 · JavaScript · Web前端 · Markdown


<html>
<head>
<title>show hide toggle</title>
<script type='text/javascript' src="jquery/jquery-1.3.1.js"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		$("#show").click(function(){
			$("#showDiv").show(1000,alert(100));
		});
		$("#hide").click(function(){
			$("#showDiv").hide(1000,alert(200));
		});
		$("#toggle").click(function(){
			$("#showDiv").toggle(1000,alert(300));
		});
	});
</script>
<style>
	.showDiv
	{
		width:200px;
		height:200px;
		border:1px red solid;
	}
</style>
</head>

<body>

<div class="showDiv" style="display:none;" id="showDiv">show and hide</div>
<p style="display: none">Hello</p>

<input type="button" value="Show" id="show" />
<input type="button" value="Hide" id="hide" />
<input type="button" value="Toggle" id="toggle" />
</body>
</head>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。