//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");
}
}
});
})