/*public*/
/*public*/
/*ea_h*/
/*语言版本切换*/
$(function(){
$(".xiala").hide();
$(".language_img").click(function(){
$(".xiala").toggle(200);
});
})
/*语言版本切换*/
/*ea_h*/
/*ea_n*/
/*xn_mn_2_wrap*/
$(function(){
if ($('#xn_mn_2_wrap').length>0) {
var xn_nav = $('.xn_mn_2_nav');
var xn_nav_box = xn_nav.children('.xn_mn_2_box');
var xn_nav_ul = xn_nav.children('ul');
$('#xn_mn_2_wrap ul li a').prepend("");
xn_nav_ul.hide();
xn_nav_box.click(function() {
$(this).toggleClass('xn_mn_2_box_curr');
xn_nav_ul.stop().slideToggle(400);
});
}
})
/*end_xn_mn_2_wrap*/
/*ea_n*/
/*ea_ba*/
/*xn_index_mba_1_wrap*/
var IsFast=true;
var isAutoPlay = true;
var banner=function(){
if($("#xn_index_mba_1_wrap").length > 0){
var $wrap = $("#xn_index_mba_1_wrap");
var $main = $(".xn_index_mba_1_main");
var $ul = $(".xn_index_mba_1_ul");
var $li = $ul.children("li");
var $lights = $(".xn_index_mba_1_lights");
var speed =300;
var $curr_class = "xn_index_mba_1_lightsCurr";
var timeInterval = 3000;
$li.css("width",parseInt($main.outerWidth(true)));
$ul.css("width",$li.length * $li.outerWidth(true));
$lights.html("");
$li.each(function(){
$lights.append("");
$(this).attr("lights",$(this).index());
});
var idx;
var size = $li.size();
//点击焦点图切换:
$lights.children().first().addClass($curr_class);
$lights.children("span").click(function(){
var index = $(this).index();
idx = parseInt($ul.children().first().attr("lights"));
var num = index-idx;
num = num>0?num:num+size;
for(var i = 0;i < num ;i++){
$ul.append($ul.children().first());
}
$ul.stop().animate({"left":0},speed);
idx = $ul.children().first().attr("lights");
$lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class);
//$ul.animate({"left":-index*$li.outerWidth(true)},speed);
//$(this).addClass($curr_class).siblings().removeClass($curr_class);
});
//左右切换:
function nextImg(){
$ul.stop().animate({left:"-"+$li.outerWidth(true) +"px"},speed,function(){
$ul.append($ul.children().first());
$ul.css("left",0);
idx = $ul.children().first().attr("lights");
$lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class);
return idx;
});
}
function prevImg(){
$ul.css('left',-$li.outerWidth(true));
$ul.prepend($ul.children().last());
$ul.stop().animate({"left":0},speed);
idx = $ul.children().first().attr("lights");
$lights.children().eq(idx).addClass($curr_class).siblings().removeClass($curr_class);
}
if(IsFast){
IsFast=false;
var auto = setInterval(function(){
if(isAutoPlay){
nextImg();
}
},timeInterval);
}
$ul.mouseover(function(){
clearInterval(auto);
});
$ul.mouseleave(function(){
IsFast=false;
auto = setInterval(function(){
if(isAutoPlay){
nextImg();
}
},timeInterval);
});
var dragDistance = 80 ;
var dragY = 20;
}
}
$(function(){
banner();
$(window).resize(function(){ banner();})
});
/*end_xn_index_mba_1_wrap*/
/*ea_ba*//*ea_c*/
/*xn_mc_pro_1_wrap*/
function setImagepro1(){
var img_height=$('.xn_mc_pro_1_protMain img:eq(0)').height();
$('.xn_mc_pro_1_protMain img').each(function(){
$(this).parent().height(img_height);
});
$('.xn_mc_pro_1_protMain img').unbind('load').bind('load',function(){
setTimeout(function() {
var img_height=$('.xn_mc_pro_1_protMain img:eq(0)').height();
$('.xn_mc_pro_1_protMain img').each(function(){
$(this).parent().height(img_height);
});
}, 1000);
});
}
$(function(){
if($("#xn_mc_pro_1_wrap").length > 0){
setImagepro1();
$(window).resize(function(){ setImagepro1();})
}
});
/*end_xn_mc_pro_1_wrap*/
/*xn_mc_index2_1_wrap*/
function setImageindex1(){
var img_height=$('.xn_mc_index2_1_conten img:eq(0)').height();
$('.xn_mc_index2_1_conten img').each(function(){
$(this).parent().height(img_height);
});
$('.xn_mc_index2_1_conten img').unbind('load').bind('load',function(){
setTimeout(function() {
var img_height=$('.xn_mc_index2_1_conten img:eq(0)').height();
$('.xn_mc_index2_1_conten img').each(function(){
$(this).parent().height(img_height);
});
}, 1000);
});
}
$(function(){
if($("#xn_mc_index2_1_wrap").length > 0){
setImageindex1();
$(window).resize(function(){ setImageindex1();})
}
});
/*end_xn_mc_index2_1_wrap*/
/*xn_mc_index_2_wrap*/
function setImage(){
var img_height=$('.xn_mc_index_2_subUl img:eq(0)').height();
$('.xn_mc_index_2_subUl img').each(function(){
$(this).parent().height(img_height);
});
$('.xn_mc_index_2_subUl img').unbind('load').bind('load',function(){
setTimeout(function() {
var img_height=$('.xn_mc_index_2_subUl img:eq(0)').height();
$('.xn_mc_index_2_subUl img').each(function(){
$(this).parent().height(img_height);
});
}, 1000);
});
}
/*end_xn_mc_index_2_wrap*/
/*xn_mc_index_14_wrap*/
/*end_xn_mc_index_14_wrap*/
/*xn_mc_index_abouts_wrap*/
function setImagenewsv11(){
var img_height=$('.xn_mc_index_abouts_mbox img:eq(0)').height();
$('.xn_mc_index_abouts_mbox img').each(function(){
$(this).parent().parent().height(img_height);
});
$('.xn_mc_index_abouts_mbox img').unbind('load').bind('load',function(){
setTimeout(function() {
var img_height=$('.xn_mc_index_abouts_mbox img:eq(0)').height();
$('.xn_mc_index_abouts_mbox img').each(function(){
$(this).parent().parent().height(img_height);
});
}, 1000);
});
}
$(function(){
if($("#xn_mc_index_abouts_wrap").length > 0){
setImagenewsv11();
$(window).resize(function(){ setImagenewsv11();})
}
});
$(document).ready(function(){
if ($("#xn_mc_index_abouts_wrap").length>0) {
var oWrapDiv=$("#xn_mc_index_abouts_wrap");
var oRollBox=$("#xn_mc_index_abouts_mbox");
var oRollBox_li=oRollBox.children("li");
var iRollBox_li_length=oRollBox_li.length;
var iRollBox_li_width=oRollBox_li.outerWidth(true);
var speed=500;
var iNumber=1;//每屏滚动个数
var oControl=$("#xn_mc_index_abouts_control");
var iCont=Math.ceil(iRollBox_li_length/iNumber);//焦点的个数
var oConcurr="xn_mc_index_abouts_concurr";
var isOff=true;//是否开启自动滚动
var ifreetime=2000;//自动滚动时间间隔
var timer=null;
var _this=0;
oRollBox.width(iRollBox_li_length*iRollBox_li_width).css("position","relative");
oRollBox_li.each(function(){
$(this).attr("index",$(this).index());
$(this).width(iRollBox_li_width);
});
for (var j = 0; j < iCont; j++) {
oControl.append("");
};
var oCon_span=oControl.children("span");
oCon_span.first().addClass(oConcurr);
var iMovew=iRollBox_li_width*iNumber;
var keys=-1;
oCon_span.click(function(){
_this=$(this).index();
keys=_this;
$(this).addClass(oConcurr).siblings().removeClass(oConcurr);
oRollBox.stop().animate({left:-_this*iMovew},speed);
//oRollBox_li.appendTo(oRollBox);
});
function oAutoScroll(){
timer=setInterval(function(){
keys+=1;
if (keys>oCon_span.length) {
keys=0;
};
oCon_span.eq(keys).click();
},ifreetime);
}
if (isOff) {
oAutoScroll();
oWrapDiv.hover(function(){
clearInterval(timer);
},function(){
oAutoScroll();
})
};
};
});
/*end_xn_mc_index_abouts_wrap*/
/*ea_c*/
/*ea_b*/
/*xn_mb_1_wrap*/
/*end_xn_mb_1_wrap*/
/*ea_b*/
/*ea_bg*/
/*ea_bg*/
/*ea_sh*/
/*ea_sh*/
/*ea_mu*/
/*footer-nav*/
$(function(){
//$("#nav_VMenu2").hide();
$(".footer-nav3").click(function(){
$(".footer-nav-ul").stop().slideToggle(400);
});
$(".footer-nav5").click(function(){
$(".footer-nav-ul2").stop().slideToggle(400);
});
});
/*end_footer-nav*/
/*footer-back*/
$(function(){
$(window).scroll(function(){
if ($(window).scrollTop()>200){
$(".footer-back").css("opacity","1");
}else{
$(".footer-back").css("opacity","0");
}
});
$(".footer-back").click(function(){
$("html,body").animate({"scrollTop":0});
});
});
/*end_footer-back*/
/*ea_mu*/