$ && $(function () {
try {
if ($("#xn_h_12_wrap").length>0) {
eims_c_40000.init();
$("#eims_c_40000_loginedname").wrap("");
};
} catch (err) { }
});
var eims_c_40000 = {
init: function () {
$("#eims_c_40000_loginout").click(eims_c_40000.loginout);
ajaxmethod("user", "islogin", null, function (data) {
if (isnullorempty(data)) {
return;
}
if (data.result != 1) {
if (isnullorempty(data.msg.name)) {
$("#eims_c_40000_normallname").remove();
$("#eims_c_40000_normallname1").remove();
} else {
$("#eims_c_40000_normallname").html(data.msg.name);
}
$("#eims_c_40000_logined").remove();
$("#eims_c_40000_normall").show();
return;
}
$("#eims_c_40000_loginedname").html(data.msg.name);
$("#eims_c_40000_normall").remove();
$("#eims_c_40000_logined").show();
});
},
loginout: function () {
ajaxmethod("user", "logout", null, function (data) {
if (data == "ok") {
document.location.reload();
}
});
}
}
$(function(){
$(window).scroll(function(){
if ($(this).scrolltop()>0) {
$('#ea_h').addclass('ea_h_fff');
$('.logo01').fadeout(500);
$('.logo02').fadein(500);
}else{
$('#ea_h').removeclass('ea_h_fff');
$('.logo01').fadein(500);
$('.logo02').fadeout(500);
}
})
});
$(function(){
var tr = "
";
$('#xn_n_14_vmenu1').append(tr);
$('#xn_n_14_vmenu1 li').each(function(){
$(this).mouseenter(function(){
var i = $(this).index();
var pos = i*122;
if(i<5){
$('.li_cur').stop(true,true).animate({'left':pos+'px'},500);
}
});
});
$("#xn_n_14_vmenu1") .mouseleave(function(){
$('.li_cur').animate({'left':'0px'},500);
})
});
$(function(){
settimeout(function(){
$('.xn_ba_js_13_bigimg').addclass('xn_ba_js_13_bigimg1');
},500)
});
$(function(){
$('.xn_n_14_wrap_main>ul>li').eq(5).css('paddingright','0');
});
var xn_ba_js_13_autoplay = true;
var xn_ba_js_13_interval = 6000;
var bannerw = "100%";
var xn_ba_js_13_nextfunc;
var xn_ba_js_13_timer;
$(document).ready(function () {
if ($("#xn_ba_js_13_banner").length>0) {
xn_ba_js_13_start();
};
});
var xn_ba_js_13_start = function () {
//banner第一屏
// $('.xn_ba_js_13_banner').height($(window).height());
// $('.xn_ba_js_13_bigimg img').height($(window).height());
// $(window).resize(function(event) {
// $('.xn_ba_js_13_banner').height($(window).height());
// $('.xn_ba_js_13_bigimg img').height($(window).height());
// });
var maxlen = 0;
var index = 0;
var prev = -1;
var imgw, imgh, sizew, sizeh = 0;
var running = false;
maxlen = $(".xn_ba_js_13_element").length;
imgw = $(".xn_ba_js_13_bigimg").find("img").eq(0).width();
imgh = $(".xn_ba_js_13_bigimg").find("img").eq(0).height();
for (var i = 0; i < $(".xn_ba_js_13_element").length; i++) {
var ele = $(".xn_ba_js_13_element").eq(i).find("img");
ele.attr("src", ele.attr("data-original"));
}
var btndata = "";
for (var i = 0; i < maxlen; i++) btndata += '';
$(".xn_ba_js_13_btn").html(btndata);
var btn = $(".xn_ba_js_13_btn").find("li").eq(0);
var btnw = btn.width() + math.round(btn.css("margin-left").replace(/[a-za-z]/g, ""));
var marginright = (maxlen-1)*10;
var _width = maxlen * btnw+marginright;
var _left = ($(window).width()-_width)*0.5;
console.log(marginright)
$(".xn_ba_js_13_btn").css({"width": _width,'left':_left});
btn.attr("class", "xn_ba_js_13_element_btn_on");
$(".xn_ba_js_13_banner").css("visibility", "visible");
if (bannerw == "100%") {
sizew = $(window).width()*1.1;
} else {
sizew = parseint(bannerw);
}
var _pos1 = math.round(sizew / 2 - imgw / 2);
for (var i = 0; i < maxlen; i++) {
$(".xn_ba_js_13_element").eq(i).attr("id", "ea_ba_no_b_" + i);
var _pos = math.round(imgw * (i - index) + sizew / 2 - imgw / 2);
var _pos2;
if (i == index) _opa = 1;
if (_pos > sizew) {
_pos -= maxlen * imgw
} else if (_pos < -imgw) {
_pos += maxlen * imgw
}
_pos2=_pos - _pos1;
$(".xn_ba_js_13_element").eq(i).css({
right: _pos2,
opacity: 0
}).animate({
opacity: _opa
}, {
duration: 400,
easing: 'linear'
})
}
onresize();
$(window).resize(onresize);
function onresize() {
if (bannerw == "100%") {
sizew = $(window).width()*1.1;
} else {
sizew = parseint(bannerw);
}
var _pos1 = math.round(sizew / 2 - imgw / 2);
for (var i = 0; i < maxlen; i++) {
var _pos2;
var _pos = math.round(imgw * (i - index) + sizew / 2 - imgw / 2);
var _opa = 1;
if (i == index) _opa = 1;
if (_pos > sizew) {
_pos -= maxlen * imgw
}
_pos2=_pos-_pos1
console.log(_pos2)
$(".xn_ba_js_13_element").eq(i).stop().css({
left: _pos2,
opacity: _opa
})
}
};
$(".xn_ba_js_13_btn li").each(function (i) {
$(this).click(function () {clearinterval(xn_ba_js_13_timer);
skiphandler((i));
});
});
$("#xn_ba_js_13_prev").hover(function(){
clearinterval(xn_ba_js_13_timer);
},function(){
xn_ba_js_13_timer = setinterval(xn_ba_js_13_nextfunc, xn_ba_js_13_interval);
});
//左右切换
$("#xn_ba_js_13_prev").click(function(){
var cur = index;
cur++;
if (cur > maxlen - 1) cur = 0;
skiphandler(cur);
});
$("#xn_ba_js_13_next").click(function(){
var cur = index;
cur--;
if (cur < 0) cur = maxlen - 1;
skiphandler(cur);
});
timerrepeat();
function skiphandler(target) {
if (target == index) return;
var d = 1;
var pure = index;
if (target < pure) d = -1;
var btn = $(".xn_ba_js_13_btn").find("li");
btn.eq(pure).attr("class", "xn_ba_js_13_element_btn");
btn.eq(target).attr("class", "xn_ba_js_13_element_btn_on");
var len;
if (d == 1) {
len = target - pure;
if (len <= 1) {
index = target;
nextpage();
} else {
for (var k = pure; k <= target; k++) {
index = k;
nextpage();
}
}
} else {
len = index - target;
if (len <= 1) {
index = target;
prevpage();
} else {
for (var k = index; k >= target; k--) {
index = k;
prevpage();
}
}
}
}
function timerrepeat() {
if (!xn_ba_js_13_autoplay) return;
xn_ba_js_13_nextfunc = ispause;
xn_ba_js_13_timer = setinterval(xn_ba_js_13_nextfunc, xn_ba_js_13_interval);
}
function ispause() {
var isrun = true;
if (typeof parent.runonce != 'undefined') {
isrun = parent.runonce;
}
if (isrun) {
var cur = index;
cur++;
if (cur > maxlen - 1) cur = 0;
skiphandler(cur);
return false;
} else {
return true;
}
}
function nextpage() {
if (bannerw == "100%") {
sizew = $(window).width()*1.1;
} else {
sizew = parseint(bannerw);
}
var _pos1 = math.round(sizew / 2 - imgw / 2);
console.log(_pos1)
if (xn_ba_js_13_timer) {
clearinterval(xn_ba_js_13_timer);
timerrepeat();
}
if ($(window.parent.bannerparam).length > 0) {
window.parent.bannerparam.cur_ba_index = index;
}
_pict = $(".xn_ba_js_13_element");
for (var i = 0; i < maxlen; i++) {
var _pos = math.round(imgw * (i - index) + sizew / 2 - imgw / 2);
var _pos2;
var _opa = 1;
if (i == index) _opa = 1;
if (_pos > sizew) {
_pos -= maxlen * imgw
} else if (_pos < -imgw * 2) {
_pos += maxlen * imgw
}
_pos2 = _pos-_pos1;
_pict.eq(i).stop().css({
left: _pos + imgw
}).animate({
left: _pos2,
opacity: _opa
}, {
duration: 700,
easing: 'easeoutquint'
})
_pict.eq(i).find('img').css('transform','scale(1.1)');
}
}
function prevpage() {
if (bannerw == "100%") {
sizew = $(window).width()*1.1;
} else {
sizew = parseint(bannerw);
}
var _pos1 = math.round(sizew / 2 - imgw / 2);
if (xn_ba_js_13_timer) {
clearinterval(xn_ba_js_13_timer);
timerrepeat();
}
if ($(window.parent.bannerparam).length > 0) {
window.parent.bannerparam.cur_ba_index = index;
}
for (var i = 0; i < maxlen; i++) {
var _pos = math.round(imgw * (i - index) + sizew / 2 - imgw / 2);
if (_pos < -imgw) {
_pos += maxlen * imgw
} else if (_pos > sizew + imgw) {
_pos -= maxlen * imgw
}
var _pos2 = _pos - _pos1;
$(".xn_ba_js_13_element").eq(i).stop().css({
left: _pos - imgw
}).animate({
left: _pos2
}, {
duration: 700,
easing: 'easeoutquint'
})
}
}
}
jquery.extend(jquery.easing, {
def: 'easeoutquint',
swing: function (x, t, b, c, d) {
return jquery.easing[jquery.easing.def](x, t, b, c, d);
}, easeoutquint: function (x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
}
});
$(function(){
var ohotbox=$("#xn_c_index_15_hotbox")
var ofocus=$("#xn_c_index_15_focus");
ohotbox.children(".xn_c_index_15_item").each(function(index, element) {
ofocus.append("")
});
var ofocus_btn=$("#xn_c_index_15_focus>span");
var $lis = $('.xn_c_index_15_listli');
$lis.attr("index", function () {
return $(this).index()
});
ofocus.find("span").eq(0).addclass("curr");
ohotbox.find(".xn_c_index_15_item").eq(0).show();
$lis.eq(0).addclass('margintop09');
$lis.eq(0).addclass('curr_r');
$lis.eq(0).find('.index_15_listli_b').stop().animate({'width': 560},3000);
var s = 0;
var num = 0;
function move1(){
num=1;
if (num >=1) {
//初始化
$lis.eq(0).addclass('curr_r');
$lis.eq(0).siblings().removeclass('curr_r');
$lis.eq(0).addclass('margintop09');
$lis.eq(0).find('.index_15_listli_b').stop().animate({'width': 560},3000);
$lis.eq(0).siblings().find('.index_15_listli_b').stop().animate({'width': 0},3000);
}
$lis.eq(s).appendto('.xn_c_index_15_listul');
s++;
// console.log(s)
$lis.eq(s).addclass('curr_r');
$lis.eq(s).addclass('margintop09');
// $lis.eq(s).siblings().css({'margintop': '30px'});
$lis.eq(s).siblings().removeclass('margintop09');
$lis.eq(s).siblings().removeclass('curr_r');
$lis.eq(s).find('.index_15_listli_b').stop().animate({'width': 560},3000);
$lis.eq(s).siblings().find('.index_15_listli_b').stop().animate({'width': 0},3000);
if (s>=$lis.length) {
s=0;
}
$('.xn_c_index_15_item').eq(s).show();
$('.xn_c_index_15_item').eq(s).siblings().hide();
ofocus_btn.eq(s).addclass('curr');
ofocus_btn.eq(s).siblings().removeclass('curr');
}
var time1 = setinterval(move1,3000);
$lis.each(function() {
$(this).on('mouseenter',function(){
clearinterval(time1);
index = $(this).attr('index');
$('.xn_c_index_15_item').eq(index).show();
$('.xn_c_index_15_item').eq(index).siblings().hide();
$(this).addclass('curr_r');
$(this).siblings().removeclass('curr_r');
$(this).find('.index_15_listli_b').stop().animate({'width': 560},3000);
$(this).siblings().find('.index_15_listli_b').stop().animate({'width': 0},3000);
})
$(this).on('mouseleave',function(){
time1 = setinterval(move1,3000);
})
});
$(window).scroll(function(){
if($(".xn_c_index_15_wrap").offset().top-$(window).scrolltop()<300){
$('.xn_c_index_15_colname').animate({margintop: '0px',opacity:'1'}, 2000);
$('.xn_c_index_15_hot').delay(1000).animate({marginleft: '0px',opacity:'1'}, 2000);
$('.xn_c_index_15_list').delay(1500).animate({paddingright: '0px',opacity:'1'}, 2000);
$('.index_15_wrap_more').delay(1000).animate({opacity:'1'}, 1000);
}else if($(window).width()<1000 && $(".xn_c_index_15_wrap").offset().top-$(window).scrolltop()>500){
$('.xn_c_index_15_colname').animate({margintop: '0px',opacity:'1'}, 2000);
$('.xn_c_index_15_hot').delay(1000).animate({marginleft: '0px',opacity:'1'}, 2000);
$('.xn_c_index_15_list').delay(1500).animate({paddingright: '0px',opacity:'1'}, 2000);
$('.index_15_wrap_more').delay(1000).animate({opacity:'1'}, 1000);
}
});
});
$(function(){
var win_h_2 = $(window).height()/2;
var left_li = $('.left_btn_ul>li');
var left_btn_banner = $('.xn_ba_js_13_banner').offset().top+$(this).height();
var left_btn_pro1 = $('.column').offset().top+$('.column').height()/2;
var left_btn_pro2 = $('.new_products').offset().top+$('.new_products').height()/2;
var left_btn_video = $('.index_video').offset().top+$('.index_video').height()/2;
var left_btn_news = $('.xn_c_index_15_wrap').offset().top+$('.xn_c_index_15_wrap').height()/2-390;
left_li.each(function() {
});
left_li.eq(0).on('click',function(){
$(this).addclass('left_btn_on').siblings().removeclass('left_btn_on');
$('html,body').stop().animate({'scrolltop':'0'},1000);
});
left_li.eq(1).on('click',function(){
$(this).addclass('left_btn_on').siblings().removeclass('left_btn_on');
$('html,body').stop().animate({'scrolltop':$('.column').offset().top-$('.top').height()},1000);
});
left_li.eq(2).on('click',function(){
$(this).addclass('left_btn_on').siblings().removeclass('left_btn_on');
$('html,body').stop().animate({'scrolltop':$('.new_products').offset().top-$('.top').height()},1000);
});
left_li.eq(3).on('click',function(){
$(this).addclass('left_btn_on').siblings().removeclass('left_btn_on');
$('html,body').stop().animate({'scrolltop':$('.index_video').offset().top-$('.top').height()},1000);
});
left_li.eq(4).on('click',function(){
$(this).addclass('left_btn_on').siblings().removeclass('left_btn_on');
$('html,body').stop().animate({'scrolltop':$('.xn_c_index_15_wrap').offset().top-$('.top').height()},1000);
});
if($(this).scrolltop()<=$(window).height()){
left_li.eq(0).addclass('left_btn_on').siblings().removeclass('left_btn_on');
}
$(window).scroll(function(){
var sc_top = $(this).scrolltop();
var win_h = $(window).height();
console.log('sc_top:'+sc_top)
if(sc_top<=win_h/2){
left_li.eq(0).addclass('left_btn_on').siblings().removeclass('left_btn_on');
}else if(sc_top<=left_btn_pro1){
left_li.eq(1).addclass('left_btn_on').siblings().removeclass('left_btn_on');
}else if(sc_top<=left_btn_pro2){
left_li.eq(2).addclass('left_btn_on').siblings().removeclass('left_btn_on');
}
else if(sc_top<=left_btn_video){
left_li.eq(3).addclass('left_btn_on').siblings().removeclass('left_btn_on');
}
else if(sc_top<=left_btn_news){
left_li.eq(4).addclass('left_btn_on').siblings().removeclass('left_btn_on');
console.log(left_btn_news)
console.log($(document).height()-$(window).height()-100)
$('.left_btn').fadein(500);
}
else if(sc_top>=$(document).height()-$(window).height()-100){
// console.log(1)
// left_li.eq(4).removeclass('left_btn_on');
$('.left_btn').fadeout(500);
}
})
});
$(function (){
$('.column_box_r_ul>li').eq(0).show();
$('.column_ul>li').each(function(){
$(this).on('click',function(){
$(this).addclass('column_li_on').siblings().removeclass('column_li_on');
var num1 = $(this).index();
$('.column_box_r_ul>li').eq(num1).show();
$('.column_box_r_ul>li').eq(num1).siblings().hide();
});
$(this).mouseenter(function(){
$(this).find('img').css('top','25px');
}).mouseleave(function(){
$(this).find('img').css('top','30px');
})
});
$('.column_box_r011_ul').each(function(index, el) {
$(this).find('.column_box_r011_li').eq(14).css('border-bottom','none');
});
$('.column_box_r013_ul').each(function(index, el) {
$(this).find('.column_box_r013_li').eq(3).css('margin-bottom','0');
});
$('.column_box_r011_li').each(function(index, el) {
$(this).on('mouseenter',function(){
if($(this).find('.column_box_r012_ul>li').length !== 0){
$(this).find('.column_box_r012_ul').show();
}
$(this).siblings().find('.column_box_r012_ul').hide();
// alert(1)
});
$(this).on('mouseleave',function(){
$(this).find('.column_box_r012_ul').hide('slow/400/fast', function() {
});
});
});
});
$(function(){
var $lis = $('.new_products_box_li');
$('.new_products_box_ul').width($lis.length*$lis.outerwidth(true));
$lis.eq(0).addclass('products_name_on');
$('.products_next').on('click',function(){
var i = $('.products_name_on').index();
$lis.eq(i+1).addclass('products_name_on').siblings().removeclass('products_name_on');
if(i==$lis.length-1){
$lis.eq(0).addclass('products_name_on').siblings().removeclass('products_name_on');
}
});
$('.products_prev').on('click',function(){
var i = $('.products_name_on').index();
if(i==0){
$lis.eq($lis.length-1).addclass('products_name_on').siblings().removeclass('products_name_on');
}
$lis.eq(i-1).addclass('products_name_on').siblings().removeclass('products_name_on');
});
$lis.each(function() {
$(this).on('mouseenter',function(){
$(this).addclass('products_name_on');
$(this).siblings().removeclass('products_name_on');
})
});
$(window).scroll(function(){
if($(".new_products_box").offset().top-$(window).scrolltop()<300){
$('.new_products_top').animate({margintop: '0px',opacity:'1'}, 2000);
$('.new_products_box_con').delay(500).animate({margintop: '0px',opacity:'1'}, 2000);
}
});
$('.products_li_con').mouseenter(function(){
var wvalue=330;
var hvalue=330;
$('.products_li_img img').animate({width: "330",
height: "330",
left:"-15",
top:"-15"}, 1000);
$(this).css('opacity','0.7');
}).mouseleave(function(){
$('.products_li_img img').animate({width: "300",
height: "300",
left:"0px",
top:"0px"}, 1000 );
$(this).css('opacity','0');
});
});
$(function () {
$('.cooldog_content_ul>li').each(function() {
$(this).addclass('p'+($(this).index()+1));
});
//鼠标移入显示左右箭头和关闭按钮
var timer = '';
$('.video_li_box').mouseover(function () {
clearinterval(timer);
}).mouseleave(function () {
// timer = setinterval(btn_right, 4000);
});
//点击关闭隐藏轮播图
$('.btn_close').on('click', function () {
$('.video_li_box').hide('1000');
});
var arr = ['p1', 'p2', 'p3'];
var index = 0;
//上一张
$('.btn_left').on('click', function () {
btn_left();
});
//下一张
$('.btn_right').on('click', function () {
btn_right();
});
//上一张
$('.btn_left2').on('click', function () {
btn_left();
});
//下一张
$('.btn_right2').on('click', function () {
btn_right();
});
//图片自动轮播
//timer = setinterval(btn_right, 4000);
//点击上一张的封装函数
function btn_left() {
arr.unshift(arr[2]);
arr.pop();
$('.cooldog_content li').each(function (i, e) {
$(e).removeclass().addclass(arr[i]);
})
index--;
if (index < 0) {
index = 2;
}
show();
}
//点击下一张的封装函数
function btn_right() {
arr.push(arr[0]);
arr.shift();
$('.cooldog_content li').each(function (i, e) {
$(e).removeclass().addclass(arr[i]);
})
index++;
if (index > 2) {
index = 0;
}
show();
}
$(window).scroll(function(){
if($(".index_video").offset().top-$(window).scrolltop()<300){
$('.index_video_top').animate({margintop: '30px',opacity:'1'}, 2000);
$('.cooldog_content').delay(500).animate({margintop: '0px',opacity:'1'}, 2000);
$('.btn_box').delay(1000).animate({margintop: '0px',opacity:'1'}, 2000);
}
});
if(navigator.appname == "microsoft internet explorer"&&parseint(navigator.appversion.split(";")[1].replace(/[ ]/g, "").replace("msie",""))<10){
$('.video_li_box').hide();
$('.video_span03').show();
}
})
$(function(){
$('.foot_nav>ul>li').each(function() {
if ($(this).index()>4) {
$(this).hide();
}
});
$('.foot_nav>ul>li>ul>li').each(function() {
if ($(this).index()>3) {
$(this).hide();
}
});
$('.foot_nav>ul>li>ul').each(function() {
var aa = $(this).prev().clone();
aa.text('more +');
aa.css({
color: '#fff',
fontsize: '14px'
});
var index = $(this).children('li').length;
if(index>=4){
aa.appendto($(this));
}
});
})
$(function(){
$("#foot_type1ul_t301 li a").removeattr("rel", "nofollow")
});
$(function(){
$("#foot_type1ul_t901 a").attr("rel", "nofollow")
})