$(function () { //$('#header').load('header.html') //$('#footer').load('footer.html') $('body').css('opacity', 1) var proList = 0 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') == 'proList' && $(e).html() != '') { proList += 100 $(e).css("animation-delay", proList + 'ms') } if ($(e).attr('data-type') == 'newsList' && $(e).html() != '') { newsList += 100 $(e).css("animation-delay", newsList + 'ms') } } }) wow.init() setTimes() var timeOuts = null function setTimes() { timeOuts = setTimeout(function() { proList = 0 newsList = 0 }, 150) } /*****************************手机站导航切换按钮*******************************/ $('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) }) $('body').on('mouseenter', '.header_nav li', function () { $(this).children('.header_nav2').stop().slideDown(200) $(this).addClass('on').siblings('.active').addClass('unactive').removeClass('active') }) $('body').on('mouseleave', '.header_nav li', function () { $(this).children('.header_nav2').stop().slideUp(200) $(this).removeClass('on').siblings('.unactive').addClass('active').removeClass('unactive') }) $('body').on('mouseenter', '.header_nav li .search_i', function () { $(this).parent().addClass('active') $('.header_nav li.search input').focus() }) $('body').on('mouseleave', '.header_nav li .search_i', function () { $(this).parent().removeClass('active') $('.header_nav li.search input').blur() }) $('body').on('keyup', '.header_nav li.search input', function (e) { if (e.keyCode == 13 && $('.header_nav li.search input').val() != '' && $('.header_nav li.search').hasClass('active')) { //if (e.keyCode == 13 && $('.header_nav li.search').hasClass('active')) { window.location.href = 'result.html?keywords=' + $('.header_nav li.search input').val() } }) $('body').on('click', '.header_nav li.search .img', function () { if ($('.header_nav li.search input').val() != '' && $('.header_nav li.search').hasClass('active')) { //if ($('.header_nav li.search').hasClass('active')) { window.location.href = 'result.html?keywords=' + $('.header_nav li.search input').val() } }) })