const isMobile = () => window.innerWidth <= 750;
$(function () {
var winheight = $(window).height();
// setTimeout(function() {
var bannerMarginTop = parseFloat($('.banner').css('margin-top'));
//console.log(bannerMarginTop);
$('.qmmBanner .bd ul').height(winheight - bannerMarginTop);
$('.qmmBanner .bd ul li').height(winheight - bannerMarginTop);
// }, 600);
})
var winwidth = $("window").width();
$(".qmmTopNav .nav2 .qmmBusiness.hide").width(winwidth);
$(function () {
$(".qmmBanner").slide({
titCell: ".pagination",
mainCell: ".bd ul",
effect: "leftLoop",
autoPage: true,
autoPlay: true,
interTime: 6000,
// easing:"easeOutCirc",
trigger: "click",
mouseOverStop: "false",
vis: "auto"
});
$(".qmmWapBanner").slide({
mainCell: ".swiper-wrapper",
effect: "leftLoop",
autoPage: true,
autoPlay: true,
interTime: 6000,
// easing:"easeOutCirc",
trigger: "click",
mouseOverStop: "false"
});
for (let i = 0; i < Math.ceil($('.q_jList').find('li').length / 4); i++) {
$('.q_jdot').append('
1');
}
$(".q_jswiper").slide({
titCell: ".q_jdot",
mainCell: ".bd ul",
autoPage: true,
effect: "left",
scroll: 4,
vis: 4,
trigger: "click"
})
if (isMobile()) {
const text = $('.footer .left').text()
$('.footer .left').html(`${text.split('iSoftStone').join('
iSoftStone')}`)
new Swiper('.swiper-index', {
speed: 800,
autoplay: {
disableOnInteraction: false,
delay: 4000,
},
pagination: {
el: '.swiper-index-pagination'
},
noSwiping: true,
loop: true,
})
function createObserve(swiper) {
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
swiper.autoplay.start();
} else {
swiper.autoplay.stop();
}
});
}, {
threshold: 0.1,
rootMargin: '0px'
});
const swiperContainer = swiper.$el[0];
observer.observe(swiperContainer);
}
const aboutSwiper = new Swiper($('.swiper-about-container'), {
speed: 800,
autoplay: {
delay: 3500,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination'
},
autoHeight: true,
loop: true,
effect: 'coverflow',
centeredSlides: true,
coverflowEffect: {
rotate: 0,
stretch: -25,
depth: 80,
modifier: 2,
slideShadows: false,
},
});
createObserve(aboutSwiper);
const coreSwiper = new Swiper($('.swiper-core-container'), {
speed: 1000,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
autoHeight: true,
loop: true,
pagination: {
el: '.swiper-pagination'
},
});
createObserve(coreSwiper);
new Swiper($('.swiper-company-container'), {
speed: 800,
autoplay: {
delay: 2000,
disableOnInteraction: false,
},
loop: true,
pagination: {
el: '.swiper-pagination'
},
effect: 'coverflow',
slidesPerView: 1.2,
centeredSlides: true,
coverflowEffect: {
rotate: 0,
stretch: -15,
depth: 80,
modifier: 2,
slideShadows: false,
},
});
}
});
//console.log($("img.scale").length);
$("img.scale").imageScale();
addNum();
function addNum() {
var endNum = [];
var True = true;
$('.index .part4 .roll span').each(function (i) {
endNum.push($('.index .part4 .roll span').eq(i).text());
$('.index .part4 .roll span').eq(i).text(0);
});
function increase(index, current) {
var sup = endNum[index];
if (current > sup) return;
$(".index .part4 .roll span:eq(" + index + ")").text(current);
setTimeout(function () {
increase(index, current + 1)
}, 80);
}
}
const menuList = $('.secMenu a')
let active = $('.secMenu a.active')
$(menuList).on('click', function(e) {
window.removeEventListener('scroll', handleScroll)
$('.secMenu a').each(function () {
$(this).removeClass('active')
})
$(this).addClass('active')
active = $(this)
$("html, body").animate({scrollTop: $($(this).attr("href")).offset().top + "px"}, 500, () => window.addEventListener('scroll', handleScroll));
return false;
})
$('.secMenu').on('mouseenter', function () {
active.removeClass('active')
})
$('.secMenu').on('mouseleave', function () {
active.addClass('active')
})
const idList = ['home', 'about', 'digital', 'core', 'careers', 'contact', 'company']
function handleScroll(e) {
if (window.scrollY > 400) {
$('.headNav').find('.botCon').css('backgroundColor', '#fff')
} else {
$('.headNav').find('.botCon').css('backgroundColor', 'rgba(255,255,255,0.5)')
}
idList.forEach(ele => {
if (window.scrollY - 50 < $(`#${ele}`).offset().top && window.scrollY + 50 > $(`#${ele}`).offset().top) {
$('.secMenu a').each(function () {
$(this).removeClass('active')
})
$(`.secMenu a[href="#${ele}"]`).addClass('active')
active = $(`.secMenu a[href="#${ele}"]`)
}
})
}
window.addEventListener('scroll', handleScroll)
$(function () {
$('.szhfw').eq(0).addClass('active')
const digitalLiList = $('.digital').find('li.ibox')
digitalLiList.eq(0).addClass('active')
const digitalContent = $('.digital').find('.content-box p').hide()
digitalContent.eq(0).show()
for (let i = 0; i < digitalLiList.length; i++) {
const ele = digitalLiList[i];
$(ele).on(isMobile() ? 'click' : 'mouseenter', () => {
$(ele).siblings().removeClass('active')
$(ele).addClass('active')
digitalContent.hide()
digitalContent.eq(i).show()
})
}
})
$('.footer a').on('click', function () {
$("html, body").animate({scrollTop: $($(this).attr("href")).offset().top + "px"}, 500);
})
$('.mp-head .lang-right').click(function () {
$(this).toggleClass('active');
$('.mp-head .lang-wrap').slideToggle(200);
})