代码改变世界

动画停止和延时

2011-07-18 15:44  Rollen Holt  阅读(374)  评论(0编辑  收藏  举报
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>

		<title>hello</title>

		<meta http-equiv="Content"  "content=text/html; charset=utf-8" />
		<script type="text/javascript"

		src="jquery-1.5.0-vsdoc.js"></script>

		<script type="text/javascript"

		src="jquery-1.4.2.js"></script>

		<style type="text/css">
			body {
				font-size:13px
			}
			.divFrame {
				border:solid 1px #666;
				width:233px;
				text-align:center;
			}
			.divFrame .divTitle {
				background-color:#eee;
				padding:5px 0px 5px 0px
			}
			.divFrame .divContent {
				padding:5px 0px 5px 0px
			}
			.divFrame .divContent img {
				border:solid 1px #eee;
				padding:2px
			}
		</style>

		<script type="text/javascript">
			$(function(){
				$("a:eq(0)").click(function(){
					$("img").slideToggle(3000);
				})
				$("a:eq(1)").click(function(){
					$("img").stop();
				})
				$("a:eq(2)").click(function(){
					$("img").delay(2000).slideToggle(3000);
				})
			})
		</script>
	</head>
	<body>
		<div class="divFrame">

			<div class="divTitle">

				<a href="javascript:void(0)">开始</a>  |  

				<a href="javascript:void(0)">停止</a>  |  

				<a href="javascript:void(0)">延时</a>

			</div>

			<div class="divContent">

				<img src="1.gif" alt="" title="Log图片" />

			</div>

		</div>

	</body>

</html>