$(function () { $('body').css('opacity', 1) $('.header').addClass('fixed'); $('.h_ej').addClass('fixed'); var newsList = 0 var wow = new WOW({ boxClass: 'wow', // 闇€瑕佹墽琛屽姩鐢荤殑鍏冪礌鐨 class animateClass: 'animated', // animation.css 鍔ㄧ敾鐨 class offset: 0, // 鍏冪礌鐨勪綅缃湶鍑哄悗璺濈搴曢儴澶氬皯鍍忕礌鎵ц mobile: true, // 鏄惁鍦ㄧЩ鍔ㄨ澶囦笂鎵ц鍔ㄧ敾 live: true, // 寮傛鍔犺浇鐨勫唴瀹规槸鍚︽湁鏁 callback: function (e) { if ($(e).attr('data-type') == 'newsList') { newsList += 100 $(e).css('animation-delay', newsList + 'ms') } } }) wow.init() setTimes() var timeOuts = null function setTimes () { timeOuts = setTimeout(function () { proList = 0 newsList = 0 }, 150) } $('img').attr({"alt":'鏅槈'}); /*****************************鎵嬫満绔欏鑸垏鎹㈡寜閽?******************************/ $('body').on('click', '.headerSJ .navbar', function (event) { $('.headerSJ .navwrap').animate({ 'left': '0px', 'opacity': '1' }, 800) $('.headerSJ .navbg').fadeIn(800) }) $('body').on('click', '.headerSJ .navbg', function (event) { $(this).fadeOut(800) $('.headerSJ .navwrap').animate({ 'left': '-50%', 'opacity': '0' }, 800) }) $('body').on('click', '.headerSJ .plus', function () { //浜岀骇鏍忕洰鎵嬮鐞村垏鎹㈡晥鏋 $(this).toggleClass('minus').parent().siblings().find('.minus').removeClass('minus') $(this).next('.SJbod').stop().slideToggle(300).parent().siblings().find('.SJbod').stop().slideUp(500) }) var st = $(window).scrollTop() // if (st > 0) { // $('.header').addClass('fixed'); // $('.h_ej').addClass('fixed'); // } else { // $('.header').removeClass('fixed'); // $('.h_ej').removeClass('fixed'); // } $('.countup').each(function (index, el) { var id = $(el).attr('id') || '_countup' + (new Date().getTime()) + $(el).index('.countup') $(el).attr('id', id) el.countOnOff = true el.options = $(el).attr('options') ? JSON.parse($(el).attr('options')) : { "separator": "" } el.num = new CountUp(id, 0, $(el).text(), 0, 5, el.options) if (st > $(el).offset().top - $(window).height() + $(el).outerHeight() && el.countOnOff) { el.num.start() el.countOnOff = false } }) $(window).scroll(function () { /*婊氬姩鏃跺厛娓呴櫎涓婁竴涓畾鏃跺櫒,鐒跺悗鍐嶈缃柊鐨勫畾鏃跺櫒,浠ュ厤鍑虹幇澶氫釜瀹氭椂鍣ㄩ€犳垚娣蜂贡*/ clearTimeout(timeOuts) setTimes() st = $(window).scrollTop() // if (st > 0) { // $('.header').addClass('fixed'); // $('.h_ej').addClass('fixed'); // } else { // $('.header').removeClass('fixed'); // $('.h_ej').removeClass('fixed'); // } $('.countup').each(function (index, el) { if (st > $(el).offset().top - $(window).height() + $(el).outerHeight() && el.countOnOff) { el.num.start() el.countOnOff = false } }) }) // 浼樺寲a鏍囩 $('a').each(function () { if ($(this).attr('href') == '') { $(this).attr('href', 'javascript:;') } else if ($(this).attr('href') == undefined) { $(this).css('cursor', 'pointer') } }) $('body').on('click', '.video_btn', function () { var videoSrc = $(this).attr('data-videoSrc') || '' var tit = $(this).attr('data-tit') || '' var subTit = $(this).attr('data-subTit') || '' $('#video_model video').attr('src', videoSrc) $('#video_model .text h6').text(tit) $('#video_model .text p').text(subTit) if (!tit) $('#video_model .text h6').hide() if (!subTit) $('#video_model .text p').hide() $('#video_model').fadeIn() }) $('body').on('click', '#video_model .mask, #video_model .close', function () { $('#video_model').fadeOut() $('#video_model video').attr('src', '') }) $('body').on('mouseenter', '.header_nav > li', function () { $(this).children('.header_nav2, .header_nav3').stop().slideDown(200) $(this).addClass('on').siblings('.active').addClass('unactive').removeClass('active') }) $('body').on('mouseleave', '.header_nav > li', function () { $(this).children('.header_nav2, .header_nav3').stop().slideUp(200) $(this).removeClass('on').siblings('.unactive').addClass('active').removeClass('unactive') }) $('body').on('mouseenter', '.header', function () { $('.h_ej').stop(true,false).fadeIn(); }) $('body').on('mouseleave', '.header', function () { $('.h_ej').stop(true,false).fadeOut(); }) $('body').on('mouseenter', '.h_ej', function () { $('.h_ej').stop(true,false).fadeIn(); }) $('body').on('mouseleave', '.h_ej', function () { $('.h_ej').stop(true,false).fadeOut(); }) var navI = $('body').data('index') setTimeout(function () { $('.header_nav li').eq(navI).addClass('active').siblings().removeClass('active'); }) $('body').on('click', '.backup', function () { $('html, body').animate({scrollTop: 0},400) }) })