淡入淡出

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="js/jquery-1.12.4.min.js">
			
		</script>
		<style type="text/css">
			img{
				width: 300px;
				height: 400px;
			}
		</style>
	</head>
	<body>
		<input type="button" name="" id="" value="隐藏" />
		<input type="button" name="" id="" value="显示" />
		<input type="button" name="" id="" value="切换显示隐藏" />
		<hr />
		<img src="img/lu.jpg" title="我是小路" alt="图片出不来提示文本"/>
	
	
	</body>
	<script type="text/javascript">
		$('input').eq(0).click(function(){
//			$('img').stop().hide(1000)
//			$('img').fadeOut(2000)
			$('img').slideUp(2000)
		})
		
		$('input').eq(1).click(function(){
			$('img').stop().show(1000)
//			$('img').fadeIn(2000)
//				卷起展开必须有宽高
//			$('img').slideDown(2000)
		})
		
		$('input').eq(2).click(function(){
//			$('img').toggle(3000)
//			$('img').fadeToggle(2000)
			$('img').slideToggle(2000)
		})
		
		

猜你喜欢

转载自blog.csdn.net/weixin_42322206/article/details/88841816