日期:2014-05-16 浏览次数:21678 次
<title>无标题页</title>
<style type="text/css">
.v-img0
{
top: 200px;
left: 400px;
position: absolute;
z-index:0;
}
.v-img1
{
position: absolute;
top: 200px;
left: 360px;
z-index:1;
}
.v-img2
{
position: absolute;
top: 200px;
left: 320px;
z-index:2;
}
.img{}
</style>
</head>
<body>
<script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function (){
$("#hide").bind("click",function(){
$(".v-img").slideUp(2000);
});
$("#show").bind("click",function(){
$(".v-img").animate({left:"400px",opacity:"0.5"},3000);
});
$(".v-img0,.v-img1,.v-img2").mousemove(function (){
$(this).css("top","170px");
});
$(".v-img0,.v-img1,.v-img2").mouseout(function (){
$(this).animate({top:"200px"},500);
});
$(".v-img0,.v-img1,.v-img2").click(function (){
if( $(this).css("left")=="320px" ){//点第一张图片
}
if( $(this).css("left")=="360px" ){//点中间那张图片
// $(this).css({left:"320px",zIndex:2});
$("#img2").attr("id","imgx");
$(this).attr("id","img2");
$("#img0").attr("id","img1");
$("#imgx").attr("id","img0");
$("#img0").addClass("v-img0");
$("#img1").addClass("v-img1");
$(this).addClass("v-img2");
}
if( $(this).css("left")=="400px" ){//点最后一张图片
}
});
})
</script>
<div>
<img class="v-img0" id="img0" src="img/0.JPG" alt="" />
<img class="v-img1" id="img1" src="img/1.JPG" alt="" />
<img class="v-img2" id="img2" src="img/2.JPG" alt="" />
</div>
</body>
</html>