function Init () { if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true }); wow.init() } backTop(); } // 导航栏 function navHover () { var top = 0; $(window).scroll(function () { top = $(this).scrollTop() if ( top !== 0 ) { $('.header').css({'background': '#fff'}) } else { $('.header').css({'background': 'none'}) } }); $('.nav-list > li').on('mouseover', function () { if(top == 0) { $('.header').css({'background': '#fff'}) } $('.header').css({'border-bottom': '1px solid #e9eaea'}); var findRes = $(this).find('.sec-nav').length; var num = $('.sec-nav').length; if (findRes > 0) { for (var i = 0; i < num; i++) { $('.sec-nav').eq(i).slideUp(); } if ($('.sec-nav').is(':visible')) { $(this).find('.sec-nav').stop().show(); } else { $(this).find('.sec-nav').slideDown(); } }else { for (var i = 0; i < num; i++) { $('.sec-nav').eq(i).slideUp(); } } }); $('.header').on('mouseleave', function () { $('.sec-nav').slideUp(function () { setTimeout(function () { if(top == 0) { $('.header').css({'background': 'none'}) } $('.header').css({'border-bottom': '0'}); }, 300) }); }) } function navHover1 () { var top = 0; $(window).scroll(function () { top = $(this).scrollTop(); }); $('.nav-list > li').on('mouseover', function () { if(top == 0) { $('.header').css({'background': '#fff'}) } $('.header').css({'border-bottom': '1px solid #e9eaea'}); var findRes = $(this).find('.sec-nav').length; var num = $('.sec-nav').length; if (findRes > 0) { for (var i = 0; i < num; i++) { $('.sec-nav').eq(i).slideUp(); } if ($('.sec-nav').is(':visible')) { $(this).find('.sec-nav').stop().show(); } else { $(this).find('.sec-nav').slideDown(); } }else { for (var i = 0; i < num; i++) { $('.sec-nav').eq(i).slideUp(); } } }); $('.header').on('mouseleave', function () { $('.sec-nav').slideUp(function () { setTimeout(function () { if(top == 0) { $('.header').css({'background': 'none'}) } $('.header').css({'border-bottom': '0'}); }, 300) }); }) } // 首页 工程案例 function caseHover () { $('.case-list').on('mouseover', 'li', function () { $(this).find('.case-hover').removeClass('moveOut').addClass('moveIn') } ).on('mouseleave', 'li', function () { $(this).find('.case-hover').removeClass('moveIn').addClass('moveOut') }) } // 首页新品上市 function newPro() { // 显示右边的详情图片 var index = 0; $('.npr-r-box').eq(0).show(); // 判断有几个三个产品一列 var line = $('.npr-l-list .npr-l-box').length; // 每个产品的点击 $(document).on('click', '.nprl-pic-box', function() { var picI = $(this).index(); index = ($(this).parent('.npr-l-list').index() * 3) + picI; active($('.nprl-pic-box'), 'new-pro-on', picI); var num = $('.npr-r-box').length; for(var i=0; i 1) { click = (++click > (line - 1))?(line - 1):click; $('.npr-l-list').animate({'left': -(click * 240) + 'px'}, 500, function() { animated = 0; }); // 图片切换的时候,on对象跟着变,右边的图片详情页跟着变 proOn(click); } } }); } // 左右切换的时候,右边图片自动定位到相对应的产品 function proOn(aIndex) { var num = $('.nprl-pic-box').length; for(var i=0; i0 || navigator.userAgent.indexOf("MSIE 9.0")>0) { console.log('ie'); formEle.find('label').css({'display':'block'}); formEle.find('label').on('click', function() { $(this).parent('form').find('input').focus(); }); formEle.find('input').on('keyup', function() { if($(this).val().length == 0) { $(this).parent('form').find('label').css({'display':'block'}); }else { $(this).parent('form').find('label').css({'display':'none'}); } }); } } // 人才招聘 动画 function job() { $('.job-detail').stop().slideDown('slow'); } function jobClose() { $('.job-detail').stop().slideUp('slow'); } // 问卷调查 function btn() { $('.check-box a').attr('data-click',0); $('.qt').on('click', 'a', function() { var index = $(this).parent('p').parent('dd').parent('dl').index(); var type = $(this).parent('p').parent('dd').attr('class'); switch(type) { case 'radio': num = $(this).parent('p').parent('dd').parent('dl').find('a').length; for(var i=0; i= 1) { check = true; }else { check = false; } break; case 'num': var val = $('.num input').val(); if(val != '' && isNaN(val) == false) { check = true; }else { check = false; } break; } qtNum.push({'num':i,'res':check}); console.log(qtNum[i]); } forNum = 0; for(var i=0; i 200) { $('.backTop-box').show(); }else { $('.backTop-box').hide(); } }); } // 新闻列表切换 function newsTab(index) { var num = $('.news-tab li').length; for(var i=0; i 7) { for (var j = 0; j < m; j++) { $(".header_daohan ul li").eq(7 + j).hide(); } $(".header_menu").click(function () { if (temp == 1) { for (var j = 0; j < m; j++) { $(".header_daohan ul li").eq(j).hide(); } for (var j = 0; j < m; j++) { $(".header_daohan ul li").eq(7 + j).show(); } temp = 2; } else { for (var j = 0; j < m; j++) { $(".header_daohan ul li").eq(j).show(); } for (var j = 0; j < m; j++) { $(".header_daohan ul li").eq(7 + j).hide(); } temp = 1; } }); } }); function topSearch() { var key = $("#key").val(); if (!key || key == "") { alert('请输入搜索关键字'); return false; } return true; } $(function () { $('.header_search').click(function () { $('.search_form').toggleClass('open'); return false; }); })