$(function () {
$('.img-box').each(function () {
var dataW = $(this).data('wnum');
var dataH = $(this).data('hnum');
if (dataW || dataH) {
var nums = (dataH / dataW).toFixed(8) * 100 + '%';
console.log(nums);
$(this).css({ 'padding-bottom': nums })
}
});
//导航效果
// const showAnim = gsap.from('.header', {
// yPercent: -100,
// paused: true,
// duration: 0.4
// }).progress(1);
// ScrollTrigger.create({
// start: "top top",
// end: 99999,
// onUpdate: (self) => {
// self.direction === -1 ? showAnim.play() : showAnim.reverse()
// }
// });
//banner
var swiperBanner = new Swiper('.index-banner .swiper', {
slidesPerView: 1,
spaceBetween: 0,
loop: false,
watchSlidesProgress: true,
speed: 1000,
watchOverflow: true,//因为仅有1个slide,swiper无效
autoHeight: true, //高度随内容变化
// autoplay: {
// delay: 5000
// },
lazy: {
loadPrevNext: true,
},
pagination: {
el: '.banner .swiper-pagination',
clickable: true
},
on: {
init: function (swiper) {
// slide = this.slides.eq(1);
// slide.addClass('ani-slide');
// // this.emit("transitionEnd")
// var videoBor = $(".swiper .swiper-slide");
// var videolist = videoBor.find("video");//video閻庣數顢婇挅鍕极閹殿喚鐭�
// var $video =$(this.slides.eq(this.activeIndex)).find("video")[0];
// if($video){
// // $video.pause();
// $video.addEventListener("ended", function (e) {
// swiperBanner.slideNext()
// });
// $(this.slides.eq(this.activeIndex)).on("click", '.video-show',function () {
// console.log('0000');
// swiperBanner.autoplay.stop();
// if ($video.paused) {
// $(this).find('.p-icon').hide();
// $video.play();
// } else {
// $(this).find('.p-icon').show();
// $video.pause();
// }
// });
// }
// videoBor.on("click", function () {
// swiperBanner.autoplay.stop();
// if ($video.paused) {
// $(this).find('.p-icon').hide();
// $video.play();
// } else {
// $(this).find('.p-icon').show();
// $video.pause();
// }
// });
},
transitionStart: function () {
for (i = 0; i < this.slides.length; i++) {
slide = this.slides.eq(i);
slide.removeClass('ani-slide');
}
var $video = $(this.slides.eq(this.activeIndex)).find("video")[0];
if ($video) {
$video.currentTime = 0
$video.play();
}
},
transitionEnd: function () {
slide = this.slides.eq(this.activeIndex);
slide.addClass('ani-slide');
var $video = $(this.slides.eq(this.activeIndex)).find("video")[0];
if (!$video) {
this.autoplay.start();
}
// var index = this.activeIndex
// if ($video) {
// swiperBanner.autoplay.stop();
// if ($video.paused) {
// $(this.slides.eq(this.activeIndex)).find('.p-icon').show();
// } else {
// $(this.slides.eq(this.activeIndex)).find('.p-icon').hide();
// }
// $video.addEventListener("ended", function (e) {
// console.log('0001');
// swiperBanner.slideNext()
// });
// $(this.slides.eq(this.activeIndex)).on("click", '.video-show', function () {
// console.log('0000');
// swiperBanner.autoplay.stop();
// if ($video.paused) {
// $(this).find('.p-icon').hide();
// $video.play();
// } else {
// $(this).find('.p-icon').show();
// $video.pause();
// }
// });
// }
}
}
});
//手机导航
$(window).resize(function () {
var wWidth = $(window).width();
if (wWidth < 1000) {
//导航
$('nav#menuWap').mmenu({
navbar: {
title: '国际精密'
},
navbars: [
{
position: 'top',
content: [
'prev',
'title',
'close'
]
}
]
});
} else {
try {
$(".about-devprocess .devprocess-box").mCustomScrollbar('destroy');
// 模拟滚动条
$(".about-devprocess .devprocess-box").mCustomScrollbar({
horizontalScroll: true,
scrollButtons: {
enable: true
},
theme: "grey-thin"
});
$('.devprocess-list .d-con .text').each(function () {
$(this).mCustomScrollbar('destroy');
$(this).mCustomScrollbar({
horizontalScroll: false,
scrollButtons: {
enable: true
},
theme: "grey-thin2"
});
})
} catch (e) {
//TODO handle the exception
}
}
});
$(window).resize();
// 返回顶部按钮
if ($(this).scrollTop() == 0) {
$("#toTop").fadeOut(500);
}
$(window).scroll(function (event) {
/* Act on the event */
if ($(this).scrollTop() == 0) {
$("#toTop").fadeOut(500);
}
if ($(this).scrollTop() != 0) {
$("#toTop").fadeIn(500);
}
});
$("#toTop").click(function (event) {
/* Act on the event */
$("html,body").animate({
scrollTop: "0px"
}, 666)
});
//
var swiperAutoImg = new Swiper('.auto-bigimgshow .swiper', {
slidesPerView: 1,
spaceBetween: 20,
effect: 'fade',
// loop: true,
speed: 1000,
allowTouchMove: false,
// autoplay:true,
on: {
init: function (swiper) {
slide = this.slides.eq(0);
slide.addClass('ani-slide');
},
transitionStart: function () {
for (i = 0; i < this.slides.length; i++) {
slide = this.slides.eq(i);
slide.removeClass('ani-slide');
}
},
transitionEnd: function () {
slide = this.slides.eq(this.activeIndex);
slide.addClass('ani-slide');
}
}
});
//banner
var swiperAuto = new Swiper('.auto-left .swiper', {
loopedSlides: 5,
watchSlidesProgress: true,
slidesPerView: 'auto',
direction: 'vertical',
loop: true,
spaceBetween: 0,
allowTouchMove: false,
speed: 1000,
centeredSlides: true,
// autoplay: {
// delay: 5000
// },
breakpoints: {
1000: { //当屏幕宽度大于等于320
slidesPerView: 3,
allowTouchMove: true,
direction: 'horizontal',
spaceBetween: 10,
// centeredSlides: false,
},
},
// centeredSlidesBounds: true,
// loopAdditionalSlides: 3,
on: {
transitionStart: function () {
swiperAutoImg.slideTo(this.realIndex, 1000, false);//切换到第一个slide,速度为1秒
},
progress: function (progress) {
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideProgress = this.slides[i].progress;
// console.log(Math.abs(slideProgress));
modify = 1;
if (Math.abs(slideProgress) > 1) {
modify = (Math.abs(slideProgress) - 1) * 1 + 1;
}
translate = Math.abs(slideProgress) * modify * 20 + 'px';
// scale = 1 - Math.abs(slideProgress) / 5;
zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
slide.transform('translateX(' + translate + ')');
slide.css('zIndex', zIndex);
slide.css('opacity', 1);
if (Math.abs(slideProgress) > 3) {
slide.css('opacity', 0);
}
}
},
setTransition: function (transition) {
console.log(transition, 'transition');
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
},
}
})
$('.auto-left .swiper .swiper-slide').click(function () {
swiperAuto.autoplay.stop();
var num = $(this).data('num');
swiperAuto.slideToLoop(num, 1000, false);//切换到第一个slide,速度为1秒
});
$('.auto-mechine-cont .auto-right .auto-bigimgshow .sm-img').each(function () {
var leftn = $(this).data('left');
var topn = $(this).data('top');
if (leftn || topn) {
$(this).css({ 'left': leftn, 'top': topn })
}
});
function wowDelay (box, row, delayTime, fisrtDelay = 0) {
console.log(box, row, delayTime);
$(box).children().each(function (index) {
for (var i = 0; i < row; i++) {
if (index % row == i) {
$(this).attr("data-wow-delay", fisrtDelay + i * delayTime + 's');
};
};
});
};
function wowInt () {
if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: false,
live: true
});
wow.init();
};
}
wowInt();
// wowDelay('.panter-swiper .swiper-wrapper', $('.panter-swiper .swiper-wrapper .swiper-slide').length, 0.1);
wowDelay('.wenhua-swiper .swiper-wrapper', $('.wenhua-swiper .swiper-wrapper .swiper-slide').length, 0.1);
wowDelay('.pd-imglist ul', $('.pd-imglist ul li').length, 0.1);
wowDelay('.area-box ul', $('.area-box ul li').length, 0.3);
wowDelay('.text6-list ul', $('.text6-list ul li').length, 0.1);
wowDelay('.ptext8-list ul', $('.ptext8-list ul li').length, 0.1);
wowDelay('.prodetail-other ul', $('.prodetail-other ul li').length, 0.1);
wowDelay('.about-hzlist ul', $('.about-hzlist ul li').length, 0.1);
wowDelay('.news-overviewlist ul', $('.news-overviewlist ul li').length, 0.1);
wowDelay('.news-indlist ul', $('.news-indlist ul li').length, 0.1);
wowDelay('.join-team ul', $('.join-team ul li').length, 0.1);
$('.about-video').click(function () {
var $video = $(this).find("video")[0];
if ($video.paused) {
$(this).find('.p-icon').remove();
$video.play();
$(this).find('.icon').remove()
} else {
$video.pause();
}
});
$('.area-box li').each(function () {
var lileft = $(this).data('left');
var litop = $(this).data('top');
$(this).css({ 'left': lileft, top: litop })
})
var swiperIndexApp = new Swiper('.application-swiper .swiper', {
slidesPerView: 'auto',
spaceBetween: 30,
freeMode: true,
loop: true,
speed: 1000,
autoHeight: true, //高度随内容变化
autoplay: true,
pagination: {
el: '.a-page .swiper-pagination',
type: 'fraction',
renderFraction: function (currentClass, totalClass) {
return '0' +
' / ' +
'0';
},
},
navigation: {
nextEl: ".a-page .swiper-button-next",
},
breakpoints: {
1000: { //当屏幕宽度大于等于320
slidesPerView: 1,
},
},
// autoplay:{
// delay:5000
// },
})
try {
swiperIndexApp.el.onmouseleave = function () {
swiperIndexApp.autoplay.start();
},
swiperIndexApp.el.onmouseover = function () {
swiperIndexApp.autoplay.stop();
}
} catch (error) {
}
$('.application-swiper .swiper-slide').hover(function () {
$(this).addClass('cur').siblings().removeClass('cur');
})
// var swiperIndexLogo = new Swiper('.panter-swiper .swiper', {
// slidesPerView: 6,
// spaceBetween:22,
// // grid: {
// // rows: 2,
// // },
// slidesPerGroup :6,
// slidesPerColumn:2,
// autoplay:true,
// speed: 1000,
// // autoHeight: true, //高度随内容变化
// pagination: {
// el: '.panter-swiper .swiper-pagination',
// clickable: true
// },
// breakpoints: {
// 1000: { //当屏幕宽度大于等于320
// slidesPerView: 3,
// },
// },
// // on:{
// // slideChangeTransitionEnd: function(swiper){
// // console.log($(this.slides[this.activeIndex]).find('.p-item').attr('class'));
// // },
// // }
// })
$('.about-numlist .count').each(function () {
var cw = $(this).width();
$(this).width(cw);
});
$('.about-numlist').waypoint({
handler: function (direction) {
console.log(direction, '22222');
if (direction == 'up') {
$(".count").each(function () {
var _this = $(this);
num = _this.html();
id = _this.attr("id");
var demo = new countUp.CountUp(id, num, {
separator: '',
});
if (!demo.error) {
demo.start();
} else {
}
})
}
},
offset: '-15%'
})
$(".count").each(function () {
var _this = $(this);
num = _this.html();
id = _this.attr("id");
var demo = new countUp.CountUp(id, num, {
separator: '',
});
var numsc = _this.waypoint({
handler: function (direction) {
console.log(direction);
if (direction == 'up') {
demo.reset();
} else {
if (!demo.error) {
demo.start();
} else {
}
}
},
offset: '98%'
})
})
$('.f-nav li').click(function () {
$(this).addClass('cur').siblings().removeClass('cur');
});
$('.about-right').hover(function () {
$(this).addClass('cur');
});
setTimeout(function () {
$('.banner.inner-banner').addClass('cur');
}, 300)
//
// var swiperHotPro = new Swiper('.prohot-list .swiper', {
// watchSlidesProgress: true,
// slidesPerView: 'auto',
// centeredSlides: true,
// loop: true,
// loopedSlides:3,
// // autoplay: true,
// speed:1000,
// // centeredSlidesBounds: true,
// // centerInsufficientSlides: true,
// navigation: {
// nextEl: ".prohot-list .swiper-button-next",
// prevEl: ".prohot-list .swiper-button-prev",
// },
// on: {
// progress: function(progress) {
// for (i = 0; i < this.slides.length; i++) {
// var slide = this.slides.eq(i);
// var slideProgress = this.slides[i].progress;
// modify = 1;
// if (Math.abs(slideProgress) > 1) {
// modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
// }
// translate = slideProgress * modify *60 + 'px';
// scale = 1 - Math.abs(slideProgress) / 3.44;
// zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
// slide.transform('translateX(' + translate + ') scale(' + scale + ')');
// slide.css('zIndex', zIndex);
// slide.css('opacity', 1);
// if (Math.abs(slideProgress) > 2) {
// slide.css('opacity', 0);
// }
// }
// },
// setTransition: function(transition) {
// for (var i = 0; i < this.slides.length; i++) {
// var slide = this.slides.eq(i)
// slide.transition(transition);
// }
// }
// },
// });
// $('.radio-box a').click(function(){
// $(this).addClass('cur').siblings().removeClass('cur');
// });
$('.f-sort').click(function () {
console.log($(this).hasClass('down'), 2323);
if ($(this).hasClass('up')) {
$(this).attr('class', 'f-sort down')
} else if ($(this).hasClass('down')) {
$(this).attr('class', 'f-sort')
} else if (!$(this).hasClass('up') && !$(this).hasClass('down')) {
$(this).attr('class', 'f-sort up')
}
})
var swiperIndexHZ = new Swiper('.hz-swiper .swiper', {
slidesPerView: 5,
spaceBetween: 15,
autoplay: true,
speed: 1000,
// watchSlidesProgress:true,
loop: true,
// slidesPerGroup :3,
// autoHeight: true, //高度随内容变化
pagination: {
el: '.hz-swiper .swiper-pagination',
clickable: true
},
breakpoints: {
1000: { //当屏幕宽度大于等于320
slidesPerView: 3,
},
},
})
var swiperLD = new Swiper('#thumbs', {
slidesPerView: 3,
spaceBetween: 26,
// autoplay:true,
watchOverflow: true,//因为仅有1个slide,swiper无效
speed: 1000,
watchSlidesProgress: true,
// loop:true,
// slidesPerGroup :3,
// freeMode: true,
// autoHeight: true, //高度随内容变化
// pagination: {
// el: '.about-ldlist .swiper-pagination',
// clickable: true
// },
watchSlidesVisibility: true,//防止不可点击
breakpoints: {
1000: { //当屏幕宽度大于等于320
slidesPerView: 1.5,
spaceBetween: 10,
// centeredSlides: false,
},
},
})
var swiperLDTEXT = new Swiper('#gallery', {
slidesPerView: 1,
spaceBetween: 16,
speed: 1000,
// allowTouchMove:false,
watchOverflow: true,//因为仅有1个slide,swiper无效
autoHeight: true, //高度随内容变化
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
},
},
thumbs: {
swiper: swiperLD,
},
slideThumbActiveClass: 'my-slide-thumb-active',
})
////////////////////////////////////////////
// 荣誉资质swiper 开始
var swiperAboutYear = new Swiper('.year-swiper .swiper', {
slidesPerView: 7,
spaceBetween: 0,
centeredSlides: true,
// centeredSlidesBounds: true,
// autoplay:true,
// watchOverflow: true,//因为仅有1个slide,swiper无效
speed: 500,
// slideToClickedSlide: true,
// watchSlidesProgress:true,
allowTouchMove: false,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 3,
},
},
navigation: {
nextEl: ".year-swiper .swiper-button-next",
prevEl: ".year-swiper .swiper-button-prev",
},
on: {
slideChangeTransitionEnd: function () {
console.log(this.activeIndex);
$('.about-swiper-tabbox .swiper-item').eq(this.activeIndex).show().siblings().hide()
},
},
})
$('.about-honor').on('click', '.news-y', function () {
var slength = $('.about-honor .year-swiper .swiper-slide').length - 1;
console.log(slength);
swiperAboutYear.slideTo(slength, 300, false);
$('.about-swiper-tabbox .swiper-item').eq(slength).show().siblings().hide()
})
$('.about-honor').on('click', '.old-y', function () {
var slength = 0;
swiperAboutYear.slideTo(slength, 300, false);
$('.about-swiper-tabbox .swiper-item').eq(slength).show().siblings().hide()
})
//默认执行 显示最新年份
$('.about-honor .news-y').click();
$('.about-honor .year-swiper').on('click', '.swiper-slide', function () {
var sindex = $(this).index();
swiperAboutYear.slideTo(sindex, 300, false);
$('.about-swiper-tabbox .swiper-item').eq(sindex).show().siblings().hide()
});
//产品分类 Swiper
var swiperProLang = $('.product-page-block').length;
function CalenSwiperProp (arr) {
var sw_swiperapp = [];
for (var i = 0; i < swiperProLang; i++) {
sw_swiperapp[i] = new Swiper('.product-page-block.swiper' + i + ' .swiper', {
watchSlidesProgress: true,
slidesPerView: 3,
allowTouchMove: false,
atchOverflow: true,//因为仅有1个slide,swiper无效
spaceBetween: 30,
observer: true, //开启动态检查器,监测swiper和slide
observeParents: true, //监测Swiper 的祖/父元素
observeSlideChildren: true, //监测Swiper的子元素wrapper、pagination、navigation、scrollbar或其他一级子元素
autoplay: {
delay: 3000 + 3000 * ((i + 1) * 0.1)
},
loop: true,
speed: 1000,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 1,
},
},
navigation: {
nextEl: '.product-page-block.swiper' + i + ' .swiper-button-next',
prevEl: '.product-page-block.swiper' + i + ' .swiper-button-prev',
},
on: {
},
});
}
// for (var i = 0; i < swiperAppLang; i++) {
// }
}
CalenSwiperProp();
var swiperAppLang = $('.about-swiper-tabbox .swiper-item').length;
var arr = []
for (var i = 0; i < swiperAppLang; i++) {
arr.push(i)
if (i == swiperAppLang - 1) {
CalenSwiper(arr);
}
}
function CalenSwiper (arr) {
var sw_swiperapp = [];
var sw_swiperappText = [];
arr.forEach(function (e, i) {
// console.log('.about-honor-swiper.swiper'+i+' .swiper');
sw_swiperapp[i] = new Swiper('.about-honor-swiper.swiper' + i + ' .swiper', {
watchSlidesProgress: true,
slidesPerView: 'auto',
centeredSlides: true,
loop: true,
// loopedSlides:3,
// allowTouchMove:false,
observer: true, //开启动态检查器,监测swiper和slide
observeParents: true, //监测Swiper 的祖/父元素
observeSlideChildren: true, //监测Swiper的子元素wrapper、pagination、navigation、scrollbar或其他一级子元素
// autoplay: true,
speed: 1000,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 1,
},
},
navigation: {
nextEl: ".about-honor-swiper.swiper" + i + " .swiper-button-next",
prevEl: ".about-honor-swiper.swiper" + i + " .swiper-button-prev",
},
on: {
slideChangeTransitionEnd: function () {
// sw_swiperapp[i].slideTo(this.activeIndex, 1000, false);//切换到第一个slide,速度为1秒
},
progress: function (progress) {
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideProgress = this.slides[i].progress;
modify = 1;
if (Math.abs(slideProgress) > 1) {
modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
}
translate = slideProgress * modify * 30 + 'px';
scale = 1 - Math.abs(slideProgress) / 3.44;
zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
slide.transform('translateX(' + translate + ') scale(' + scale + ')');
slide.css('zIndex', zIndex);
slide.css('opacity', 1);
if (Math.abs(slideProgress) > 2) {
slide.css('opacity', 0);
}
}
},
setTransition: function (transition) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
}
},
});
})
// for (var i = 0; i < swiperAppLang; i++) {
// }
}
// 荣誉资质swiper 结束
////////////////////////////////////////////
var swiperKHhonor = new Swiper('.khzizhi-swiper .swiper', {
slidesPerView: 4,
spaceBetween: 42,
// centeredSlides: true,
// centeredSlidesBounds: true,
// autoplay:true,
// watchOverflow: true,//因为仅有1个slide,swiper无效
speed: 500,
// slideToClickedSlide: true,
// watchSlidesProgress:true,
// autoHeight:true,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 1,
},
},
allowTouchMove: false,
navigation: {
nextEl: ".khzizhi-swiper .swiper-button-next",
prevEl: ".khzizhi-swiper .swiper-button-prev",
},
// on: {
// slideChangeTransitionEnd: function(){
// console.log(this.activeIndex);
// $('.about-swiper-tabbox .swiper-item').eq(this.activeIndex).show().siblings().hide()
// },
// },
})
function sameHeight (tar) {
var ar1 = []
var maxN = 0;
tar.each(function () {
var hh = $(this).height();
ar1.push(hh);
maxN = Math.max(...ar1)
});
setTimeout(() => {
tar.height(maxN);
}, 100);
}
sameHeight($('.about-hzlist .text'));
sameHeight($('.news-overviewlist h3'));
sameHeight($('.news-overviewlist .text-p'));
sameHeight($('.news-indlist h3'));
sameHeight($('.about-research-list .text'));
var swiperWH = new Swiper('.wenhua-swiper .swiper', {
slidesPerView: 4,
spaceBetween: 0,
// centeredSlides: true,
// centeredSlidesBounds: true,
// autoplay:true,
// watchOverflow: true,//因为仅有1个slide,swiper无效
speed: 500,
// slideToClickedSlide: true,
// watchSlidesProgress:true,
// autoHeight:true,
allowTouchMove: false,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 1,
},
},
// on: {
// slideChangeTransitionEnd: function(){
// console.log(this.activeIndex);
// $('.about-swiper-tabbox .swiper-item').eq(this.activeIndex).show().siblings().hide()
// },
// },
})
$('.about-keyvalue .k-t h3').hover(function () {
$('.about-keyvalue li').removeClass('cur')
$(this).parents('li').addClass('act').siblings().removeClass('act')
$(this).parent().next('.t-hide').stop().slideDown().parents('li').siblings().find('.t-hide').slideUp();
});
$('.join-list .j-tt').click(function () {
$('.join-list li').removeClass('cur')
$(this).parents('li').addClass('act').siblings().removeClass('act')
$(this).next('.text').stop().slideDown().parents('li').siblings().find('.text').slideUp();
});
var swipeConLeft = new Swiper('.contact-info .con-left .swiper', {
slidesPerView: 1,
spaceBetween: 10,
speed: 500,
// autoHeight:true,
allowTouchMove: false,
breakpoints: {
1000: { //当屏幕宽度大于等于320
// allowTouchMove:true,
slidesPerView: 1,
},
},
})
var swipeConRight = new Swiper('.contact-info .con-right .swiper', {
slidesPerView: 4,
spaceBetween: 0,
speed: 500,
watchOverflow: true,
// autoHeight:true,
allowTouchMove: false,
breakpoints: {
1000: { //当屏幕宽度大于等于320
allowTouchMove: true,
slidesPerView: 1,
spaceBetween: 10,
},
},
on: {
slideChangeTransitionEnd: function () {
swipeConLeft.slideTo(this.activeIndex, 1000, false);//切换到第一个slide,速度为1秒
},
},
navigation: {
nextEl: ".contact-info .con-right .swiper-button-next",
prevEl: ".contact-info .con-right .swiper-button-prev",
},
})
$('.contact-info .con-right .swiper-slide').click(function () {
$(this).addClass('cur').siblings().removeClass('cur');
var num = $(this).index();
swipeConLeft.slideToLoop(num, 1000, false);//切换到第一个slide,速度为1秒
});
//首页合作伙伴 Swiper
var swiperLogoLang = $('.index-panter-tabbox .panter-swiper').length;
function CalenSwiperPropLogo (arr) {
var sw_swiperLogo = [];
for (var i = 0; i < swiperLogoLang; i++) {
console.log('.panter-swiper.swiper' + i + ' .swiper');
sw_swiperLogo[i] = new Swiper('.panter-swiper.swiper' + i + ' .swiper', {
slidesPerView: 6,
spaceBetween: 22,
// centerInsufficientSlides: true,
// grid: {
// rows: 2,
// },
watchSlidesProgress: true,
watchOverflow: true,
slidesPerGroup: 6,
slidesPerColumn: 2,
slidesPerColumnFill: 'row',
autoplay: true,
observer: true, //开启动态检查器,监测swiper和slide
observeParents: true, //监测Swiper 的祖/父元素
observeSlideChildren: true, //监测Swiper的子元素wrapper、pagination、navigation、scrollbar或其他一级子元素
speed: 1000,
// autoHeight: true, //高度随内容变化
pagination: {
el: '.panter-swiper.swiper' + i + ' .swiper-pagination',
clickable: true
},
breakpoints: {
1000: { //当屏幕宽度大于等于320
slidesPerView: 3,
},
},
});
}
// for (var i = 0; i < swiperAppLang; i++) {
// }
}
CalenSwiperPropLogo();
$('.index-panter-tabitem a').click(function () {
$(this).addClass('cur').siblings().removeClass('cur');
var logoIndex = $(this).index();
$('.index-panter-tabbox .tab-item').eq(logoIndex).show().addClass('animated').siblings().hide().removeClass('animated');
});
})
function GetQueryString (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
var context = "";
if (r != null)
context = decodeURIComponent(r[2]);
reg = null;
r = null;
return context == null || context == "" || context == "undefined" ? "" : context;
}