html百叶窗效果,前端jQuery实现百叶窗效果

/p>

img {

margin: 0;

padding: 0;

}

#content {

width: 1084px;

height: 525px;

margin: 20px auto;

position: relative;

overflow: hidden;

}

img {

display: inline;

position: absolute;

}

#i1 {

width: 844px;

height: 525px;

z-index: 400;

}

#i2 {

width: 904px;

height: 525px;

z-index: 300;

}

#i3 {

width: 964px;

height: 525px;

z-index: 200;

}

#q1 {

left: 844px;

z-index: 400;

}

#q2 {

left: 904px;

z-index: 400;

}

#q3 {

left: 964px;

z-index: 400;

}

#q4 {

left: 1024px;

z-index: 400;

}

#q1,

#q2,

#q3 {

filter: alpha(opacity=50);

-moz-opacity: 0.5;

-khtml-opacity: 0.5;

opacity: 0.5;

}

#q1,

#q2,

#q3,

#q4 {

cursor: pointer;

]

}

$(document).ready(function () {

$(“#q4”).click(function () {

$(“#q1”).stop(true, true).animate({ left: “0” }, 400);

$(“#q2”).stop(true, true).animate({ left: “60px” }, 400);

$(“#q3”).stop(true, true).animate({ left: “120px” }, 400);

//$(“#small img:lt($num)”).animate({left:”-844px”},1000);

$(“#i1,#i2,#i3”).stop(true, true).animate({ left: “-844px” }, 400);

});

$(“#q1”).click(function () {

var $num3 = parseInt($(“#q3”).

var $num2 = parseInt($(“#q2”).

var $num1 = parseInt($(“#q1”).

if ($num1 < 844) {

if ($num3 < 964 && $num2 < 904) {

$(“#q1”).stop(true, true).animate({ left: “844” }, 400);

$(“#q2”).stop(true, true).animate({ left: “904px” }, 400);

$(“#q3”).stop(true, true).animate({ left: “964px” }, 400);

$(“#i1,#i2,#i3”).stop(true).animate({ left: “0” }, 400);

}

if ($num3 >= 964 && $num2 < 904) {

$(“#q1”).stop(true, true).animate({ left: “844” }, 400);

$(“#q2”).stop(true, true).animate({ left: “904px” }, 400);

$(“#i1,#i2”).stop(true, true).animate({ left: “0” }, 400);

}

if ($num3 >= 964 && $num2 >= 904) {

$(“#q1”).stop(true, true).animate({ left: “844” }, 400);

$(“#i1”).stop(true, true).animate({ left: “0” }, 400);

}

} else {

$(“#q1”).stop(true, true).animate({ left: “0” }, 400);

$(“#i1”).stop(true, true).animate({ left: “-844” }, 400);

}

});

$(“#q2”).click(function () {

var $num3 = parseInt($(“#q3”).

var $num2 = parseInt($(“#q2”).

if ($num2 < 904) {

if ($num3 < 964) {

$(“#q2”).stop(true, true).animate({ left: “904px” }, 400);

$(“#q3”).stop(true, true).animate({ left: “964px” }, 400);

$(“#i2,#i3”).stop(true, true).animate({ left: “0” }, 400);

} else {

$(“#q2”).stop(true, true).animate({ left: “904px” }, 400);

$(“#i2”).stop(true, true).animate({ left: “0” }, 400);

}

} else {

$(“#q1”).stop(true, true).animate({ left: “0” }, 400);

//$(“#small img:lt($num)”).animate({left:”-844px”},1000);

$(“#i1”).stop(true, true).animate({ left: “-844px” }, 400);

}

});

$(“#q3”).click(function () {

var $num3 = parseInt($(“#q3”).css(“left”));

if ($num3 < 964) {

$(“#q3”).stop(true, true).animate({ left: “964px” }, 400);

$(“#i3”).stop(true).animate({ left: “0” }, 400);

} else {

$(“#q1”).stop(true, true).animate({ left: “0px” }, 400);

$(“#q2”).stop(true, true).animate({ left: “60px” }, 400);

$(“#i1,#i2”).stop(true, true).animate({ left: “-844” }, 400);

}

});

})

69eb024egw1eeues3e0vvj20sg0eltak.jpg%E2%80%9D

69eb024egw1eeuesc413yj20sg0elgq8.jpg%E2%80%9D

69eb024egw1eeuese6lymj20sg0eldkc.jpg%E2%80%9D

69eb024ejw1eeueq6q5ykj20sg0el78z.jpg%E2%80%9D

69eb024ejw1eeuesf2ea1j201o0emmwx.jpg%E2%80%9D

69eb024ejw1eeuesfmngjj201o0ema9u.jpg%E2%80%9D

69eb024ejw1eeuesg6ma4j201o0em742.jpg%E2%80%9D

69eb024egw1eeues0qtnpj201o0em742.jpg%E2%80%9D

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值