$(window).load(function(){ if($('.baguetteBoxOne').length){ baguetteBox.run('.baguetteBoxOne',{async:true});} }); $(function(){ //返回顶部 //$("#totop").on('touchend',function(){ //$("html,body").animate({scrollTop:"0px"},500); //}); ietester(); preani(); $(window).scroll(_animation); setTimeout(_animation,200); //ibanner_full(); //$(window).resize(function(){ibanner_full();}); $('.soubtn').click(function(){ if($(this).hasClass('on')){ $('.sou,.soutxt,.soubtn').removeClass('on'); }else{ $('.sou,.soutxt,.soubtn').addClass('on'); } }); $('#totop').click(function(){ var wt = $(window).scrollTop(); //var sh = $('body').prop('scrollHeight')-$(window).height(); if(wt>0){ $("html,body").stop(true,false).animate({scrollTop:0},500,'swing'); }else{ //$("html,body").stop(true,false).animate({scrollTop:sh},500,'swing'); } }) $('#topsoubtn').click(function(){ $(this).toggleClass('on'); $('.topsouout').slideToggle(300); }); //侧边回到顶部的显示隐藏 $(window).scroll(function(){ var sh = $(window).scrollTop() || 0; if(sh<=600){$('#totop').hide();} else{$('#totop').show();} }); $('.footewm,.topewm').on('mouseenter', function() { $(this).find('.bigewm').stop(true,true).fadeIn(300); }).on('mouseleave', function() { $(this).find('.bigewm').stop(true,true).fadeOut(300); }) $('.sideewm').on('mouseenter', function() { $(this).find('.sidebigewm').stop(true,true).fadeIn(300); }).on('mouseleave', function() { $(this).find('.sidebigewm').stop(true,true).fadeOut(300); }) $('.sidehand').hover(function(){ $(this).find('.sideinfo').toggleClass('on'); }) //导航下拉菜单 二级菜单 $(".nav>li").hover(function(){ var l = $(this).find('.navtwo'); if(l.length){ l.stop(true).fadeIn().addClass('on');} $(this).siblings('li').find('.navtwo').stop(true).fadeOut().removeClass('on'); },function(){ var l = $(this).find('.navtwo'); if(l.length){ l.stop(true).fadeOut().removeClass('on');} }); //var navtimer; //var ulyijiheight = $('.navtwo ul.yiji').height(); //var navheight = $('.nav').height(); // ////导航下拉菜单 二级菜单 //$('.nav').hover(function(){ // navtimer = setTimeout(function(){ // //定位 // //var ulleft = $('.nav').offset().left - $('.head').offset().left - $('.navtwo').offset().left; // //$('.navtwo ul.yiji').css('left',ulleft + 'px'); // //展开 // $('.navtwo').stop(true, true).animate({height: ulyijiheight },300); // },300) //},function(e){ // clearTimeout(navtimer); // var ev = window.event || e; // if(ev.offsetY >= navheight - 10); // else{ // $('.navtwo').stop(true, true).animate({height:'0'},200); // } //}); // //$('.nav li').hover(function(){ // var i = $(this).index(); // if(i == 0){ // $('.nav li').removeClass('ac'); // $('.navtwo li.yijili').removeClass('ac'); // }else{ // $('.nav li').removeClass('ac').eq(i).addClass('ac'); // $('.navtwo li.yijili').removeClass('ac').eq(i).addClass('ac'); // } //},function(){ // $('.navtwo li.yijili').removeClass('ac'); // $('.nav li').removeClass('ac'); //}); //$('.navtwo li.yijili').hover(function(){ // var i = $(this).index(); // if(i == 0){ // $('.navtwo li.yijili').removeClass('ac'); // $('.nav li').removeClass('ac'); // }else{ // $('.navtwo li.yijili').removeClass('ac').eq(i).addClass('ac'); // $('.nav li').removeClass('ac').eq(i).addClass('ac'); // } //},function(){ // $('.navtwo li.yijili').removeClass('ac'); // $('.nav li').removeClass('ac'); //}); // //$('.navtwo').mouseleave(function(e){ // var ev = window.event || e; // var x1 = $('.nav').offset().left; // var x2 = x1 + $('.nav').width(); // //$('.fbt span').text( event.clientX +' '+x1+' '+x2); // if(ev.offsetY<=10 && ev.clientX>=x1 && ev.clientX <= x2 ); // else{ // $(this).stop(true, true).animate({height:'0'},200); // } //}); //手机导航 $(".navsj a.yiji").click(function(){ var l = $(this).siblings('.navsjtwo'); if(l.length){ $(this).parents('li').toggleClass('on'); l.slideToggle(300); //$(this).find('s').first().toggleClass('on'); return false; } }); $(".navsj a.mao").click(function(){ $('.navbtn').removeClass('on'); $(".navsjout").removeClass('on'); $('.head').removeClass('on'); }); $(".navbtn").click(function(){ $(this).toggleClass('on'); $(".navsjout").toggleClass('on'); $('.head').toggleClass('on'); }); //招聘展开 $('.helplist').on('click','.zpone',function(){ $(this).parents('li').toggleClass('on'); $(this).siblings('.zpcon').slideToggle('300'); }) //招聘展开 $('.reclist').on('click','.rec-hand',function(){ var liobj = $(this).parents('li'); var bool = liobj.hasClass('on'); if(!bool){ liobj.addClass('on').siblings('li').removeClass('on'); liobj.find('.rec-con').slideDown('600'); liobj.siblings('li').find('.rec-con').slideUp('600'); }else{ liobj.removeClass('on'); liobj.find('.rec-con').slideUp('600'); } }) //首页案例切换 $('.js-qieh>*').click(function(){ $(this).addClass('on').siblings().removeClass('on'); var i = $(this).index(); $('.js-qiecon').removeClass('on').eq(i).addClass('on'); }); $('.js-qieh2>*').hover(function(){ $(this).addClass('on').siblings().removeClass('on'); var i = $(this).index(); $('.js-qiecon2').removeClass('on').eq(i).addClass('on'); }); $('.jshover-onlyon>*').hover(function(){ $(this).addClass('on').siblings().removeClass('on'); }); //点击动画 $('.ani-clickonce').on('animationend', function(){ var s = $(this).attr('aniname'); if(s) $(this).removeClass(s); }) $('.ani-clickonce').on('click', function(){ var s = $(this).attr('aniname'); if(s) $(this).addClass(s); }) $('.ani-click').on('click', function(){ var s = $(this).attr('aniname'); if(s) $(this).toggleClass(s); }) //表单验证 if($('#liuyan').length){ var liuyan1 = $("#liuyan").Validform({ tiptype:3}); } if($('#liuyan2').length){ var liuyan2 = $("#liuyan2").Validform({ tiptype:3}); } if($('#home_slider').length){ $('#home_slider').flexslider({animation : 'slide', controlNav : true, directionNav : true, animationLoop : true, slideshow : true, useCSS: false,slideshowSpeed: 5000,animationSpeed: 500, pauseOnHover: false,pauseOnAction:false, mousewheel: false,startAt: 0,prevText:'<',nextText:'>', before: function (slider){ slider.pause(); slider.play();}, after:function(slider){ var i = slider.currentSlide; $('.slides li').removeClass('ac').eq(i+1).addClass('ac'); $('.flex-control-paging li').removeClass('ac').eq(i).addClass('ac'); }, start: function(){ $('.slides li').removeClass('ac').eq(1).addClass('ac'); $('.flex-control-paging li').removeClass('ac').eq(0).addClass('ac'); } }); } ywlist_before(); //产品滚动 if($('.propic-scroll').length){ $('.propic-scroll').flexslider({animation : 'slide', controlNav : true, directionNav : true, animationLoop : true, slideshow : true, useCSS: false,slideshowSpeed: 6000,animationSpeed: 600, pauseOnHover: false,pauseOnAction:false, mousewheel: false,direction:"horizontal", before: function (slider){ slider.pause(); slider.play();},prevText:'<',nextText:'>' }); } if( $('.guolist-js .counter').length ){ var cuoption = {useEasing : false,useGrouping : false,separator : '',decimal : '.',prefix : '',suffix : ''}; var ctdemo = [], ct1 = true; // var ctdemo = new CountUp(target, startVal, endVal, decimals, duration, options); var y1 = $('.guolist-js').offset().top; var y2 = y1 + $('.guolist-js').outerHeight(); countUP(); $(window).scroll(countUP); function countUP(){ var wt = $(window).scrollTop() || 0; var wb = wt+ $(window).height(); if( ct1 && y2<= wb && y1>= wt ){ ct1 = false; $('.guolist-js .counter').each(function(i){ var n = $(this).text()-0; var start = n>1100? n-1000:0; var dura = $(this).attr('counter-time')-0 || 2; var delay = $(this).attr('counter-delay')-0 || 0; ctdemo[i] = new CountUp(this, start, n, 0, dura, cuoption); setTimeout(function(){ctdemo[i].start()},delay) }) } } } //沃霖企业文化活动 if($('#ra-slider').length){ $('#ra-slider').roundabout({btnNext: '.ranext',btnPrev: '.raprev', autoplay: true,autoplayDuration: 7000, enableDrag: true,clickToFocus:true,autoplayPauseOnHover: true,minOpacity: 1}).bind({ animationEnd: function(e) { var index = $('#ra-slider').roundabout('getChildInFocus'); $('.switcher li').removeClass('on'); $('.switcher li').eq(index).addClass('on'); } }); } $('.switcher li').on('click', function() { var index = $(this).index(); $('#ra-slider').roundabout('animateToChild', index); return false; }); //2工程案例列表 $('.js-caselist').on('click','li',function(){ var i = $(this).index(); //相关产品 //var l0 = $('.js-caselist li').not('.clone').length; //i = (i+l0-1)%l0; //if(l0 <= 1){ // $('.proprev,.pronext').addClass('disn'); // mwon('pro'); return false;} //else{ // $('.proprev,.pronext').removeClass('disn'); //} $("#slideBox").slide({mainCell:".bd ul",effect:"leftLoop", prevCell:'.proprev',nextCell:'.pronext',autoPlay:false, interTime:4000,mouseOverStop:false,defaultIndex:i}); mwon('pro'); }) if($("#slideBox").length){ var str = ''; $('.js-caselist li').each(function(i){ var u = $(this).find('img').first().attr('src'); var t = $(this).find('h3').text(); var t2 = $(this).find('.txt').text(); str += '
'+t2+'