$(window).load(function(){
positioncont();
$(window).resize(function(){
positioncont();
});
});
function positioncont(){
var windowwid = $(window).width();
if(windowwid <768){
$('nav span').click(function(){
if(!$('nav span').hasClass('on')){
$('nav span').addClass('on');
$('nav>ul').addClass('on');
$('.mask').addClass('on');
}else{
$('nav span').removeClass('on');
$('nav>ul').removeClass('on');
$('.mask').removeClass('on');
}
})
$("nav ul li").each(function () {
if ($(this).find("ul").length > 0) {
if ($(this).has('i').length > 0){
}else{
$(this).prepend("+");
}
}
});
$('body').on('click','nav ul li i',function(){
if(!$(this).parent().find('ul').hasClass('on')){
$('nav ul li').find('ul').removeClass('on');
$('nav ul li i').text('+');
$(this).parent().find('ul').addClass('on');
$(this).text('-');
}else{
$(this).parent().find('ul').removeClass('on');
$(this).text('+');
}
})
var swiper = new Swiper('.solutionslide .swiper-container', {
slidesPerView: 1,
spaceBetween: 0,
parallax: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
});
}else if(windowwid >=768 && windowwid < 1025){
$('nav span').click(function(){
if(!$('nav span').hasClass('on')){
$('nav span').addClass('on');
$('nav>ul').addClass('on');
$('.mask').addClass('on');
}else{
$('nav span').removeClass('on');
$('nav>ul').removeClass('on');
$('.mask').removeClass('on');
}
})
$("nav ul li").each(function () {
if ($(this).find("ul").length > 0) {
if ($(this).has('i').length > 0){
}else{
$(this).prepend("+");
}
}
});
$('body').on('click','nav ul li i',function(){
if(!$(this).parent().find('ul').hasClass('on')){
$('nav ul li').find('ul').removeClass('on');
$('nav ul li i').text('+');
$(this).parent().find('ul').addClass('on');
$(this).text('-');
}else{
$(this).parent().find('ul').removeClass('on');
$(this).text('+');
}
})
var sideheight = $('.solutionslideitemimg').height();
var mainheight = $('.solutionslideitem section').height();
if(sideheight > mainheight){
$('.solutionslideitem').height(sideheight);
}else{
$('.solutionslideitem').height(mainheight);
}
var swiper = new Swiper('.solutionslide .swiper-container', {
slidesPerView: 3,
spaceBetween: 40,
parallax: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
});
}else{
$("nav ul li i").remove();
$("nav ul li").mouseover(function(){
$(this).addClass('on');
$(this).find(">ul").slideDown();
})
$("nav ul li").mouseleave(function(){
$(this).removeClass('on');
$(this).find(">ul").stop(true,true).slideUp();
})
var sideheight = $('.pgside').height();
console.log(sideheight);
var mainheight = $('.pgbody').height();
console.log(mainheight);
if(sideheight > mainheight){
$('.pgs .w').height(sideheight);
}else{
$('.pgs .w').height(mainheight);
}
var swiper = new Swiper('.solutionslide .swiper-container', {
slidesPerView: 3,
spaceBetween: 40,
parallax: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
});
}
$(".backtop").click(function(){$("html,body").animate({scrollTop:0},500)});
}