// // javascript document // document.write(''); $(function(){ //input绑定 $("input[type=text],textarea").each(function () { var _this = $(this); var input_val = _this.val(); $(_this).focus(function () { var fo_val = $(this).val(); if (fo_val == input_val) { $(this).val(""); } }); $(_this).blur(function () { var bl_val = $(this).val(); if (bl_val == "") { $(this).val(input_val); } }); }); // 导航 $('.nav').find('.subnav a:last-child').addclass('last'); $('.nav').find('li').mouseenter(function(){ $(this).find('.subnav').stop(false,true).slidedown(300); }).mouseleave(function(){ $(this).find('.subnav').stop(false,true).slideup(300); }); // 首页新闻 $('.index-new .left,.index-new dl').mouseenter(function(){ $(this).addclass('active'); }).mouseleave(function(){ $(this).removeclass('active'); }); // 首页产品与解决方案 $('.index-solution').find('li').mouseenter(function(){ $(this).find('.info-box').addclass('active').stop(false,true).animate({'bottom': 0}); }).mouseleave(function(){ $(this).find('.info-box').removeclass('active').stop(false,true).animate({'bottom': -82}); }); //底部微信二维码 $('.footer-nav').find('.wechat').mouseenter(function(){ $(this).find('img').stop(false,true).fadein(300); }).mouseleave(function(){ $(this).find('img').stop(false,true).fadeout(300); }); // 底部友情链接 $('.friend-link').mouseenter(function(){ $(this).find('.tip').addclass('active'); $(this).find('ul').stop(false,true).slidedown(300); }).mouseleave(function(){ $(this).find('.tip').removeclass('active'); $(this).find('ul').stop(false,true).slideup(300); }); // 返回顶部 $(window).scroll(function() { if($(this).scrolltop() < 980 ){ $('.backtop').fadeout(300); }else{ $('.backtop').fadein(300); } }); $('.backtop').click(function(){ $('html,body').animate({ scrolltop: $('html,body').offset().top }, 800) }); // 内页导航 if($('.inner-navbox').length > 0){ var in_l = $('.inner-navbox').find('.cur').position().left; $('.inner-navbox').find('.bg').animate({'left': in_l},500); } var in_hl; $('.inner-navbox').find('a').mouseenter(function(){ in_hl = $(this).position().left; $(this).siblings('.bg').stop(false,true).animate({'left': in_hl}); }); $('.inner-navbox').mouseleave(function(){ $(this).find('.bg').stop(false,true).animate({'left': in_l}); }); bbimg($('.inner-thridnav li'),'1.1',800); // 产品中心 $('.por-centbox table').find('tr:even').addclass('graybg'); //$('.inner-fourthnav').on('click','a:not(:first)',function(){ // $(this).addclass('cur').siblings().removeclass('cur'); // $('.por-centbox').eq($(this).index()-1).stop(false,true).fadein(300).siblings('.por-centbox').stop(false,true).fadeout(0); //}); //$('.inner-fourthnav').on('click','a:first',function(){ // $(this).addclass('cur').siblings().removeclass('cur'); // $('.por-centbox').stop(false,true).fadein(300); //}); // 公司新闻 bbimg($('.new-list'),1.1,550); $('.new-list').mouseenter(function(){ $(this).addclass('active'); }).mouseleave(function(){ $(this).removeclass('active'); }); // 企业文化 $('.culture-list:even').find('dt').addclass('even'); $('.culture-list:odd').find('dt').addclass('odd'); // bbimg($('.culture-list'),1.2,500); // 质量管理 $('.honor-list li:first').addclass('active').find('.bg').fadein(); $('.honor-left .big-pic').find('img').attr('src',$('.honor-list li:first').find('img').attr('rel')); $('.honor-left').find('.title').html($('.honor-list li:first').find('img').attr('dec')); $('.honor-list').on('click','li',function(){ $(this).addclass('active').find('.bg').stop(false,true).fadein(300); $(this).siblings().removeclass('active').find('.bg').stop(false,true).fadeout(300); $('.honor-left .big-pic').find('img').stop(false,true).fadeout(0).attr('src',$(this).find('img').attr('rel')).stop(false,true).fadein(300); $('.honor-left').find('.title').stop(false,true).fadeout(0).html($(this).find('img').attr('dec')).stop(false,true).fadein(300); }); bbimg($('.honor-left .big-pic'),1.1,550); // 左侧按钮 var hlai; var hlll = $('.honor-list').find('li').length; $('.honor-left').on('click','.left',function(){ hlai = $('.honor-list').find('li.active').index(); // console.log(hlai); // hlai < 0 ? hlai++ : hlai = hlll - 1; if(hlai <= 0){ hlai = hlll - 1; }else{ hlai-- } // console.log(hlai); $('.honor-list').find('li').removeclass('active').find('.bg').stop(false,true).fadeout(300) $('.honor-list').find('li').eq(hlai).addclass('active').find('.bg').stop(false,true).fadein(300); $('.honor-left .big-pic').find('img').stop(false,true).fadeout(300).attr('src',$('.honor-list').find('li').eq(hlai).find('img').attr('rel')).stop(false,true).fadein(300); $('.honor-left').find('.title').stop(false,true).fadeout(0).html($('.honor-list').find('li').eq(hlai).find('img').attr('dec')).stop(false,true).fadein(300); }); $('.honor-left').on('click','.right',function(){ hlai = $('.honor-list').find('li.active').index() // hlai < hlll - 1 ? hlai-- : hlai = 0; if(hlai < hlll - 1){ hlai++ }else{ hlai = 0; } $('.honor-list').find('li').removeclass('active').find('.bg').stop(false,true).fadeout(300) $('.honor-list').find('li').eq(hlai).addclass('active').find('.bg').stop(false,true).fadein(300); $('.honor-left .big-pic').find('img').stop(false,true).fadeout(300).attr('src',$('.honor-list').find('li').eq(hlai).find('img').attr('rel')).stop(false,true).fadein(300); $('.honor-left').find('.title').stop(false,true).fadeout(0).html($('.honor-list').find('li').eq(hlai).find('img').attr('dec')).stop(false,true).fadein(300); }); // 右侧按钮 var hluh = $('.honor-list').find('ul').outerheight(true); var hllh = $('.honor-list').find('li').outerheight(true); var hlh = $('.honor-list').outerheight(true); var hut; $('.honor-right').on('click','.up',function(){ if($('.honor-list').find('ul').is(":animated")){return;} hut = $('.honor-list').find('ul').position().top; if(hut <= -1){ $('.honor-list').find('ul').stop(false,true).animate({'top': hut + hllh},500); } }); $('.honor-right').on('click','.down',function(){ if($('.honor-list').find('ul').is(":animated")){return;} hut = $('.honor-list').find('ul').position().top; if(hluh + hut > hlh + 5){ $('.honor-list').find('ul').stop(false,true).animate({'top': hut - hllh},500); } }); // 公司视频 bbimg($('.video-box'),1.1,550); $('.video-box').click(function () { var v_r = $(this).find('.bg').attr('rel'); $('.mask').fadein(300); $('.video-popup').fadein(300); $("#video").ckplayer({ mode: 1, video: v_r, image: "", auto: false, playerid: "p1", loaded: "loadhandler" }); }); $('.video-popup .close').click(function () { $('.mask,.video-popup').fadeout(300); }); // 中心介绍 $('.about-center').on('click','li',function(){ var acir = $(this).find('img').attr('rel'); var acit = $(this).find('span').html(); $('.ac-popup').find('img').attr('src', acir); $('.ac-popup').find('.tip').html(acit); $('.ac-popup,.mask').fadein(300); }); $('.ac-popup .close,.mask').click(function(){ $('.ac-popup').find('img').attr('src', ''); $('.ac-popup').find('.tip').html(''); $('.ac-popup,.mask').fadeout(300); }); // 联系我们 $('.address-box').find('.bg:odd').addclass('graybg'); bbimg($('.address-list'),1.1,550); }); // 图片放大 function bbimg(obj,big,spend){ obj.each(function(){ var thatiw = 0, thatih = 0, bbw = 0, bbh = 0, thati = ''; var _that = $(this); thati = _that.find('img'); thatiw = thati.width(); thatih = thati.height(); _that.mouseenter(function(){ bbw = thatiw * big; bbh = thatih * big; thati.stop(false,true).animate({ 'width': bbw, 'height': bbh, 'margin-top': -bbh / 2, 'margin-left': -bbw / 2 },spend); }).mouseleave(function(){ thati.stop(false,true).animate({ 'width': thatiw, 'height': thatih, 'margin-top': -thatih / 2, 'margin-left': -thatiw / 2 },spend); }); }); }