cbsy/blxc-admin/target/classes/static/portal/js/index.js

159 lines
3.7 KiB
JavaScript

var slideMain = new Swiper(".slideMain", {
direction: "vertical",
hashNavigation: true,
wrapperClass: "main-wrapper",
slidesPerView: "auto",
speed: 500,
resistanceRatio: 0,
mousewheel: true,
// shortSwipes : false,
pagination: {
el: ".slideMain .pagination-m",
clickable: true,
},
navigation: {
nextEl: ".leftFix .next",
prevEl: ".leftFix .prev",
},
on: {
transitionStart: function () {
if (this.isEnd) {
$(".leftFix").addClass("bottom");
} else {
$(".leftFix").removeClass("bottom");
}
if (this.activeIndex == 1 || this.activeIndex == 3) {
$(".leftFix").removeClass("bga").addClass("bgb");
} else {
$(".leftFix").removeClass("bgb").addClass("bga");
}
if (this.activeIndex == 1) {
$(".leftFix .pageBtn span").removeClass().addClass("s1");
} else if (this.activeIndex == 2) {
$(".leftFix .pageBtn span").removeClass().addClass("s2");
} else if (this.activeIndex == 3) {
$(".leftFix .pageBtn span").removeClass().addClass("s3");
} else if (this.activeIndex == 4) {
$(".leftFix .pageBtn span").removeClass().addClass("s4");
} else if (this.realIndex == 0) {
$(".leftFix .pageBtn span").removeClass().addClass("sall");
}
},
},
});
var banner = new Swiper(".banner", {
resistanceRatio: 0,
speed: 500,
spaceBetween: 5,
loop: true,
observer: true,
observeParents: true,
autoplay: {
delay: 4000,
stopOnLastSlide: false,
disableOnInteraction: false,
},
pagination: {
el: ".banner .pagination-s",
clickable: true,
},
navigation: {
nextEl: ".banner .banner-next",
prevEl: ".banner .banner-prev",
},
});
var slidenews = new Swiper(".slidenews", {
resistanceRatio: 0,
spaceBetween: 5,
speed: 500,
loop: true,
observer: true,
observeParents: true,
// autoplay: { delay: 4000,stopOnLastSlide: false,disableOnInteraction: false,},
pagination: {
el: ".slidenews .pagination-news",
clickable: true,
},
navigation: {
nextEl: ".slidenews .slideb-next",
prevEl: ".slidenews .slideb-prev",
},
});
var slidea = new Swiper(".slidea", {
resistanceRatio: 0,
spaceBetween: 5,
speed: 500,
// loop:true,
observer: true,
observeParents: true,
// autoplay: { delay: 4000,stopOnLastSlide: false,disableOnInteraction: false,},
pagination: {
el: ".slidea .pagination-a",
clickable: true,
},
navigation: {
nextEl: ".slideaa .slidea-next",
prevEl: ".slideaa .slidea-prev",
},
});
var slideb = new Swiper(".slideb", {
resistanceRatio: 0,
spaceBetween: 5,
speed: 500,
//loop:true,
observer: true,
observeParents: true,
//autoplay: { delay: 4000,stopOnLastSlide: false,disableOnInteraction: false,},
pagination: {
el: ".slideb .pagination-b",
clickable: true,
},
navigation: {
nextEl: ".slideb .slideb-next",
prevEl: ".slideb .slideb-prev",
},
});
var slidec = new Swiper(".slidec", {
resistanceRatio: 0,
spaceBetween: 5,
speed: 500,
// loop:true,
observer: true,
observeParents: true,
//autoplay: { delay: 4000,stopOnLastSlide: false,disableOnInteraction: false,},
pagination: {
el: ".slidec .pagination-c",
clickable: true,
},
navigation: {
nextEl: ".slidec .slidec-next",
prevEl: ".slidec .slidec-prev",
},
});
$(function () {
$(".leftFix .navBtn").click(function () {
$(this).toggleClass("on");
$(".subNav").toggleClass("on");
});
});
$(function () {
var w = $(window).width();
if (w <= 1279) {
slideMain.destroy(false);
}
});
$(window).resize(function () {
var w = $(window).width();
if (w <= 1279) {
slideMain.destroy(false);
} else {
window.location.reload();
}
});
window.onload = function () {
$(".loader").fadeOut();
};