手机扫码浏览
返回列表
//index-work
$.fn.pictureScroll = function () {
return this.each(function () {
var $this = $(this),
p = $this.find(“.work-buttons .work-button a.prev”),
l = $this.find(“.work-buttons .work-button a.next”),
g = $this.find(“.swiper-slide-image-wrap:first-child .swiper-slide-image”),
k = $this.find(“.swiper-slide-text-scroll .swiper-slide-text-each”),
g1 = $this.find(“.swiper-slide-image-wrap .swiper-slide-image:first-child”),
k1 = $this.find(“.swiper-slide-text-scroll .swiper-slide-text-each:first-child”),
q = $this.find(“.work-buttons .work-button .prograss-bar .lines”).width(),
d = $this.find(“.work-buttons .work-button .prograss-bar .lines .nline”),
m = $this.find(“.work-buttons .work-button .count span.current”),
r = $this.find(“.work-buttons .work-button .count span.total”),
c = g.length – 1,
n = k.length – 1,
a = 0,
b = 0,
e = q / (c + 1),
timer = null;
g1.addClass(“active”);
k1.addClass(“active”);
function f() {
g.eq(a).addClass(“active”).siblings().removeClass(“active”);
}
function h() {
k.eq(b).addClass(“active”).siblings().removeClass(“active”);
}
d.width(e);
r.html(“0” + (c + 1));
p.click(function () {
//clearInterval(timer);
a–;
b–;
a = 0 > a ? c : a;
b = 0 > b ? n : b;
f();
h();
d.css({
left: e * a
});
m.html(“0” + (a + 1));
//setInterval(timer);
});
l.click(function () {
a++;
b++;
a = a > c ? 0 : a;
b = b > n ? 0 : b;
f();
h();
m.html(“0” + (a + 1));
d.css({
left: e * a
});
//setInterval(timer);
});
var timer = setInterval(function () {
l.click()
}, 6000)
})
}
$(“.ourwork-mobile-images-scroll”).pictureScroll();