1. 程式人生 > >手風琴效果

手風琴效果

padding ora margin text script ava blue height blog

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/jquery-1.12.1.js"></script> 
<title>手風琴效果</title>
<style>
ul , h2 { padding:0; margin:0; }
li { list-style:none; }
body{}
.sfq{width:300px; height: 200px; float: left; }
.red{ background-color: red; }
.green{ background-color: green; }
.yellow{ background-color: yellow; }
.blue{ background-color:blue; }
.orange{ background-color: orange; }
</style>
<script type="text/javascript">
$(function(){
	$(‘.sfq‘).mouseover(function(){
		$(this).stop().animate({width:300},500).siblings().stop().animate({width:30},500)
	})
})
</script>
</head>
<body>
<div class="sfq red"></div>
<div class="sfq green"></div>
<div class="sfq yellow"></div>
<div class="sfq blue"></div>
<div class="sfq orange"></div>
</body>
</html>

技術分享

 

手風琴效果