当用户单击如下链接时,我正在尝试切换动画:
CSS
.men{
background: url("../img/men4.jpg") no-repeat scroll 16% 0 transparent;
height: 600px;
left: 0;
position: absolute;
width: 50%;
}
.women{
background: url("../img/women1.jpg") no-repeat scroll 84% 0 transparent;
height: 600px;
position: absolute;
right: 0;
width: 50%;
}
HTML
<div class="men">
</div>
<div class="women">
</div>
<a href="#" class="openmen">Men</a>
<a href="#" class="openwomen">Women</a>
查询
$("a.openwomen").click(function(event){
event.preventDefault();
$('.women').animate({width:"80%"});
$('.men').animate({width:"20%"});
$('.men').animate({opacity: 0.5}, 500);
$('.women').animate({opacity: 1}, 500);
});
但我不太确定如何去做,我希望当他们再次点击时它恢复到原来的状态。