//var ws=$(".rolls").width()/2;
$(function(){
$(".kf-right ul li:last,.folds-1").click(function(){
$(".kf-right").toggleClass("kf2");
});
var hgroll = new Swiper('.swiper-roll-hg', {
slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: true
//calculateHeight:true,
//paginationClickable: true
});
$(".history-backwrap .vbt-l").click(function(){ hgroll.swipePrev();})
$(".history-backwrap .vbt-r").click(function(){ hgroll.swipeNext();})
/*手册*/
var qkroll = new Swiper('.qk-roll', {
slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 2 : 1,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: false
//calculateHeight:true,
//paginationClickable: true
});
$('.qk-bt-1').on('click', function(e){
e.preventDefault()
qkroll.swipePrev()
});
$('.qk-bt-2').on('click', function(e){
e.preventDefault()
qkroll.swipeNext()
});
$(".mod-serch-l").each(function(){
$(this).click(function(event){
event.stopPropagation();
$(this).find("ul").show();
});
$(this).find("li").click(function(event){
// event.stopPropagation();
$(this).parent().parent().find("span").text($(this).text());
$(this).parent("ul").hide();
// event.stopPropagation();
});
});
$(document).click(function(){$(".mod-serch-l ul").hide();});
/*手机端调换位置*/
if($(window).width()<=480){
if($(".travel-r").size()>0)
{ $(".travel-r .item-5").html(); $(".travel-r").prepend("
"+$(".travel-r .item-5").html()+"
"); $(".travel-r .item-cell:last").remove(); }
}
$(".res-more").click(function(){$(this).toggleClass("res-more2"); });
$(".head-icons a.icon-shouye").click(function(){ $(".m-codes").toggle();});
$(".focus-us span").each(function(){
var mysthis=$(this)
$(this).click(function(){mysthis.siblings().find("cite").hide(); mysthis.find("cite").toggle()})
});
/*荣誉*/
var hornorroll = new Swiper('.hornor-roll-1', {
slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 3 : 1,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: false
//calculateHeight:true,
//paginationClickable: true
});
$(".hor-roll .vbt-l").click(function(){ hornorroll.swipePrev();})
$(".hor-roll .vbt-r").click(function(){ hornorroll.swipeNext();})
/*大事记*/
var eventroll = new Swiper('.event-roll-1', {
slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 2,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: false
//calculateHeight:true,
//paginationClickable: true
});
$('.year-bt1').on('click', function(e){
e.preventDefault()
eventroll.swipePrev();
if($(".event-roll-1 li").index($(".event-roll-1 li.active"))>0) $(".event-roll-1 li.active").removeClass("active").prev().addClass("active");
});
$('.year-bt2').on('click', function(e){
e.preventDefault()
eventroll.swipeNext();
console.log($(".event-roll-1 li").index($(".event-roll-1 li.active")));
console.log($(".event-roll-1 li").size()-1);
if($(".event-roll-1 li").index($(".event-roll-1 li.active"))<($(".event-roll-1 li").size()-1)) $(".event-roll-1 li.active").removeClass("active").next().addClass("active");
});
$(".event-roll-1 li").click(function(){
$(".event-roll-1 li").removeClass("active");
$(this).addClass("active");
});
$(".event-roll-1 li,.year-bt2,.year-bt1").click(function(){
console.log($('.event-roll-1 li').index($('.event-roll-1 li.active')));
$(".events-cnts .event-info").hide();
$(".events-cnts .event-info:eq("+$('.event-roll-1 li').index($('.event-roll-1 li.active'))+")").show();
});
/*智慧人物滚动*/
if($(window).width()<=480&&$(window).width()>=350){$(".single").css({left:-(730-$(".news-rolls").width())/2});
if($(".pre20").size()>0) $(".pre20").css({left:$(".single li.active").offset().left-30});
if($(".next20").size()>0) $(".next20").css({left:$(".single li.active").offset().left+330-45});
}
if($(window).width()<350){$(".single").css({left:-(710-$(".news-rolls").width())/2});
if($(".pre20").size()>0) $(".pre20").css({left:$(".single li.active").offset().left-35});
if($(".next20").size()>0) $(".next20").css({left:$(".single li.active").offset().left+300-35});
}
if($(window).width()>480){
var peosonerroll = new Swiper('.peosoner-roll', {
slidesPerView: 1,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.art-roll .swiper-pagination',
//onSlideChangeStart: function(swiper199){
//$(".nums cite").text(artroll.activeLoopIndex+1);
//},
loop: true
//calculateHeight:true,
//paginationClickable: true
});
$('.md-videosroll .vbt-l').on('click', function(e){
e.preventDefault()
peosonerroll.swipePrev()
});
$('.md-videosroll .vbt-r').on('click', function(e){
e.preventDefault()
peosonerroll.swipeNext()
});
}
/*艺术作品*/
var artroll = new Swiper('.art-roll', {
slidesPerView: 1,
autoplayDisableOnInteraction: false,
autoplay: 3000,
pagination: '.art-roll .swiper-pagination',
onSlideChangeStart: function(swiper199){
$(".nums cite").text(artroll.activeLoopIndex+1);
},
loop: true
//calculateHeight:true,
//paginationClickable: true
});
$('.btn-l0').on('click', function(e){
e.preventDefault()
artroll.swipePrev()
});
$('.btn-r0').on('click', function(e){
e.preventDefault()
artroll.swipeNext()
});
/*产品最终导航*/
var navroll = new Swiper('.swiper-roll-navs', {
slidesPerView: 'auto',
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: false
//calculateHeight:true,
//paginationClickable: true
});
$(".pro-bt-l").click(function(){
navroll.swipePrev();
});
$(".pro-bt-r").click(function(){
navroll.swipeNext();
});
if($('.swiper-roll-navs').size()>0){navroll.swipeTo($(".swiper-roll-navs li").index($(".swiper-roll-navs li.cr")),0);}
/*滚动聚焦*/
if($(".top-menucur ul").size()>0) $(".top-menucur ul").scrollLeft($(".top-menucur .cr").offset().left-10);
/*产品最终切换*/
var proroll = new Swiper('.pro-roll-1', {
slidesPerView: 1,
autoplayDisableOnInteraction: false,
autoplay: false,
//pagination: '.swiper-roll-1 .swiper-pagination',
loop: false,
onSlideChangeEnd: function(proroll){
$(".produ-tab li").removeClass("cr");
$(".produ-tab li:eq("+proroll.activeIndex+")").addClass("cr");
}
//calculateHeight:true,
//paginationClickable: true
});
$(".pbtn-l").click(function(){
proroll.swipePrev();
});
$(".pbtn-r").click(function(){
proroll.swipeNext();
});
$(".produ-tab li").click(function(){
$(".produ-tab li").removeClass("cr");
$(this).addClass("cr");
proroll.swipeTo($(".produ-tab li").index($(".produ-tab li.cr")));
});
/*滑过出现二维码*/
$("#mycode1,#code1").hover(function(event){
event.stopPropagation();
var sthis=$(this);
$("#mycode1").addClass("moveEvent");
setTimeout(function(){
if($("#mycode1").hasClass("moveEvent")){
$("#mycode1").addClass("hovers");
$("#code1").show();
}
},200);
},function(event){
event.stopPropagation();
var sthis=$(this);
$("#mycode1").removeClass("moveEvent");
setTimeout(function(){
if(!$("#mycode1").hasClass("moveEvent")){
$("#mycode1").removeClass("hovers");
$("#code1").hide();
}
},200);
//setTimeout(function(){},1000);
});
var swiper1 = new Swiper('.swiper-roll-1', {
slidesPerView: 1,
autoplayDisableOnInteraction: false,
autoplay: 3000,
pagination: '.swiper-roll-1 .swiper-pagination',
loop: true,
calculateHeight:true,
paginationClickable: true
});
$(".btn-l").click(function(){
swiper1.swipePrev();
});
$(".btn-r").click(function(){
swiper1.swipeNext();
});
/*新闻切换*/
$(".com-tit span").hover(function(){
$(".com-tit span").removeClass("active");
$(this).addClass("active");
$(".mod-news-1").hide();
$(".mod-news-1:eq("+$(this).index()+")").show();
$(".com-tit a").hide();
$(".com-tit a:eq("+$(this).index()+")").show();
});
/*首页产品切换*/
$(".pro-tabs li").hover(function(){
$(".pro-tabs li").removeClass("active");
$(this).addClass("active");
$(".md-pro-cell").removeClass("active");
$(".md-pro-cell:eq("+$(this).index()+")").addClass("active");
});
/*产品横向滚动条*/
if($(".rem-proinner").size()>0&&$(window).width()>480) {
$(".rem-proinner").mCustomScrollbar({
horizontalScroll:true,
advanced:{
autoExpandHorizontalScroll:true
}
});
}
if($(window).width()>480) {
$("#map1,#mdata1").hover(function(event){
event.stopPropagation();
var sthis=$(this);
$("#map1").addClass("moveEvent");
setTimeout(function(){
if($("#map1").hasClass("moveEvent")){
$("#map1").addClass("hovers");
$("#mdata1,#pic1").show();
}
},200);
},function(event){
event.stopPropagation();
var sthis=$(this);
$("#map1").removeClass("moveEvent");
setTimeout(function(){
if(!$("#map1").hasClass("moveEvent")){
$("#map1").removeClass("hovers");
$("#mdata1,#pic1").hide();
}
},200);
//setTimeout(function(){},1000);
});
$("#map2,#mdata2").hover(function(event){
event.stopPropagation();
var sthis=$(this);
$("#map2").addClass("moveEvent");
setTimeout(function(){
if($("#map2").hasClass("moveEvent")){
$("#map2").addClass("hovers");
$("#mdata2,#pic2").show();
}
},200);
},function(event){
event.stopPropagation();
var sthis=$(this);
$("#map2").removeClass("moveEvent");
setTimeout(function(){
if(!$("#map2").hasClass("moveEvent")){
$("#map2").removeClass("hovers");
$("#mdata2,#pic2").hide();
}
},200);
//setTimeout(function(){},1000);
});
}
if($(window).width()<480) {
$("#map1").click(function(event){
event.stopPropagation();
$("#mdata1,#pic1").show();
$("#mdata2,#pic2").hide();
});
$("#img2").click(function(event){
event.stopPropagation();
$("#mdata2,#pic2").show();
$("#mdata1,#pic1").hide();
});
}
/*高级搜索*/
$(".adv-search").click(function(){
$(this).toggleClass("adv-cr");
$(".searchkey-words").toggle();
});
//$(".changeBox_a1").height($(window).width()*862/1920);
//
//$(window).resize(function(){
//$(".changeBox_a1").height($(window).width()*862/1920);
//
//});
//
//
//$('.changeBox_a1 .a_bigImg').soChange({
// thumbObj: '.ul_change_a2 li',
// //导航为数字形式,选择器指向包含数字的span对象
// thumbNowClass: 'on',
// //自定义导航对象当前class为on
// changeTime: 4000,
// overStop:false,
// callback:function(){
//
// }
// //自定义切换时间为4000ms 个
// //botPrev:'#btnL', // 按钮,上一个
// // botNext:'#btnR' // 按钮,下一个
//});
//
/*搜索框*/
$(".top-search span").click(function(){
$(".in-search").toggle();
});
$(".in-search em").click(function(){
$(".in-search").toggle();
});
/*导航*/
var navH = new Array();
$(".navMenu>li").each(function (i) {
navH[i] = $(this).find(".sub-menus").height();
});
$(".sub-menus").css({
"height": 0
});
$(".navMenu>li").hover(function () {
//$(this).find(".sub-menus").slideDown();
$(this).find(".sub-menus").height(navH[$(this).index()]);
}, function () {
$(this).find(".sub-menus").height(0); //$(this).find(".sub-menus").slideUp();
});
/*$(window).scroll(function(){
if($(window).scrollTop()>0){
$(".mod-headers").addClass("mod-cr");
$(".mod-news").addClass("wow fadeInUpBig animated");
}
else{$(".mod-headers").removeClass("mod-cr");}
});*/
if($(window).width()<480){$(".leader-tit1").addClass("wow bounceInLeft animated animated");
$(".leader-per1").addClass("wow bounceInRight animated animated");}
var eventRoll = new Swiper('.swiper-roll-2', {
slidesPerView: (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 6 : 2,
//slidesPerGroup : (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 2,
autoplayDisableOnInteraction : false,
autoplay :false,
loop:false,
//slidesPerGroup:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 1,
// pagination: '.swiper-roll-1 .swiper-pagination',
grabCursor: true,
spaceBetween :0,
paginationClickable: true
});
if($(".swiper-roll-2 .item-cell").size()>0){
eventRoll.swipeTo($(".swiper-roll-2 .item-cell").index($(".swiper-roll-2 .cr")), 0, false);
};
$('.event-btl').on('click', function(e){
e.preventDefault()
eventRoll.swipePrev()
});
$('.event-btr').on('click', function(e){
e.preventDefault()
eventRoll.swipeNext()
});
$(".project-wrap .item-pic").hover(function(){swiper1.stopAutoplay();},function(){swiper1.startAutoplay();})
// var swiper1 = new Swiper('.swiper-roll-1', {
// slidesPerView: 1,
// //slidesPerGroup : (window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 2,
// autoplayDisableOnInteraction : false,
// autoplay :4000,
// //slidesPerGroup:(window.innerWidth >= 480 || document.documentElement.clientWidth >= 480) ? 5 : 1,
// pagination: '.swiper-roll-1 .swiper-pagination',
// loop:true,
// grabCursor: true,
// spaceBetween :0,
// paginationClickable: true
//
// });
/*首页轮播插件*/
// $('.changeBox_a1 .a_bigImg').soChange({
// thumbObj: '.ul_change_a2 li',
// //导航为数字形式,选择器指向包含数字的span对象
// thumbNowClass: 'on',
// //自定义导航对象当前class为on
// changeTime: 4000,
// overStop:false,
// callback:function(){
//
// }
// //自定义切换时间为4000ms 个
// //botPrev:'#btnL', // 按钮,上一个
// // botNext:'#btnR' // 按钮,下一个
// });
$(".s-close").click(function () {
$(".mobile-search").hide();
});
$(".search-mobile").click(function () {
$(".mobile-search").show();
});
/*手机导航菜单*/
var isfir = 1;
var isfir1 = 1;
$(".menus-mobiles").click(function () {
$(".menus-mobiles").toggleClass("menus-ani1");
if (isfir) {
$(".mobile-menucss:eq(0)").addClass("menu-active");
isfir1 = 1
$(".mobile-menucss:eq(1)").removeClass("menu-hide menu-active");
// $(".menus").addClass("menus-close");
isfir = 0;
} else {
if (isfir == 0) {
$(".mobile-menucss:eq(0)").toggleClass("menu-active");
$(".mobile-menucss:eq(0)").toggleClass("menu-hide");
isfir1 = 1
$(".mobile-menucss:eq(1)").removeClass("menu-hide menu-active");
//$(".menus").toggleClass("menus-close");
}
}
});
$(".head-icons .icon-shouye").click(function () {
if (isfir1) {
$(".mobile-menucss:eq(1)").addClass("menu-active");
isfir = 1
$(".mobile-menucss:eq(0)").removeClass("menu-hide menu-active");
// $(".menus").addClass("menus-close");
isfir1 = 0;
} else {
if (isfir1 == 0) {
$(".mobile-menucss:eq(1)").toggleClass("menu-active");
$(".mobile-menucss:eq(1)").toggleClass("menu-hide");
isfir = 1
$(".mobile-menucss:eq(0)").removeClass("menu-hide menu-active");
//$(".menus").toggleClass("menus-close");
}
}
});
})