$(function() {
var time;
//var winHeight = top.window.document.body.clientHeight || $(window.parent).height();
$('.client-2').css({
'marginTop': -($('.client-2').height() / 2)
});
$('#client-2 li').bind({
'mouseenter': function() {
var scope=this;
time = setTimeout(function() {
var divDom = $(scope).children('div');
var maxWidth = divDom.width();
$(scope).stop().animate({
left: 77-maxWidth
}, 'normal', function() {
var pic = $(scope).find('.my-kefu-weixin-pic');
if (pic.length > 0) {
pic.show();
}
});
}, 100)
},
'mouseleave': function() {
var pic = $(this).find('.my-kefu-weixin-pic');
var divDom = $(this).children('div');
var maxWidth = divDom.width();
if (pic.length > 0) {
pic.hide();
}
clearTimeout(time);
var divDom = $(this).children('div');
$(this).stop().animate({
left: 0
}, "normal", function() {});
}
});
//返回顶部
$(window).scroll(function() {
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
var eltop = $("#client-2").find(".my-kefu-ftop");
if (scrollTop > 0) {
eltop.show();
} else {
eltop.hide();
}
});
$("#client-2").find(".my-kefu-ftop").click(function() {
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
if (scrollTop > 0) {
$("html,body").animate({
scrollTop: 0
}, "slow");
}
});
});
/*详情页表格 开始*/
$(function() {
var fuji = $('#c_detail_wrap table').parent();
if(fuji.length>0) {
$('#c_detail_wrap table').wrap("");
$('#new-div').prepend("");
}
var h_table;
var flag_table=0;
function setTable() {
var lxl=1;
$('section#new-div').removeClass('on');
$('section#new-div').scrollTop(0,0);
$("section#new-div table,section#new-div table td").removeAttr("width");
$("section#new-div table,section#new-div table td").removeAttr("height");
$("section#new-div table").css('width','initial');
$("section#new-div table td").css('width','initial');
$("section#new-div table td").css('height','initial');
$('#c_detail_wrap table').each(function() {
if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) {
var zclientWidth=$(document).outerWidth();
var ztableWidth=$(this).outerWidth();
var zscale=zclientWidth/ztableWidth*0.871546673799;
lxl=zscale;
if(lxl>1){lxl=1;}
}
$(this).css("transform","scale(" + lxl + ")");
var h_table=$(this).height();
$(this).parent('section#new-div').height(h_table*lxl+10);
});
}
$("#c_detail_wrap table").on('click',function(){
if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) {
if(flag_table==0){
$(this).parent('section#new-div').addClass('on');
$(this).parent('section#new-div').children('table').css("transform","scale(" + 1 + ")");
$(this).parent('section#new-div').height(h_table);
flag_table=1;
}else{
setTable();
flag_table=0;
}
}
});
$("#c_detail_wrap #new-div .zoom-caret").on('click',function(){
if ( matchMedia( 'only screen and (max-width:1199px)' ).matches ) {
if(flag_table==0){
$(this).parent('section#new-div').addClass('on');
$(this).parent('section#new-div').children('table').css("transform","scale(" + 1 + ")");
$(this).parent('section#new-div').height(h_table);
flag_table=1;
}else{
setTable();
flag_table=0;
}
}
});
/*调用方法*/
setTable();
$(window).resize(function() {
/*调用方法*/
setTable();
});
/*产品详情页点击tab切换*/
$(".nyprodetail2 .hd span").on('click',function(){
var num1=$(this).index();
$(".nyprodetail2 .bd>section").eq(num1).show().siblings('.nyprodetail2 .bd>section').hide();
$(this).addClass('on').siblings('.nyprodetail2 .hd span').removeClass('on');
/*调用方法*/
setTable()
});
setTimeout(function(){
$('#c_detail_wrap table').each(function() {
var zclientWidth=$(document).outerWidth();
var ztableWidth=$(this).outerWidth();
var zscale=zclientWidth/ztableWidth*0.871546673799;
lxl=zscale;
if(lxl>1){lxl=1;}
$(this).css("transform","scale(" + lxl + ")");
var h_table=$(this).height();
$(this).parent('section#new-div').height(h_table*lxl+10);
});
},200);
});
/*详情页表格 结束*/