$(function () { new wow({ mobile: false }).init(); $('.hform').find('form').submit(function () { var val = $(this).find('input').val(); if (!val) { alert('请输入关键字'); return false } }); $('.menu-btn').on('click', function () { $('.header').find('.nav').toggle(); }); $('.sc-btn').on('click', function () { $('.header').find('.sc-form').toggle(); }); if ($(window).width() > 991) { $('.dropdown').hover(function () { $(this).addclass('open'); }, function () { $(this).removeclass('open'); }); } else { $('.dropdown').find('.arr').on('click', function () { $(this).parent().toggleclass('open'); }); } $('.lanmu').find('.arr').on('click', function () { $(this).parent().toggleclass('open'); }); $('.footer').find('dt').on('click', function () { if ($(this).parent().hasclass('open')) { $(this).parent().removeclass('open'); $(this).next().slideup(); } else { $(this).parent().addclass('open'); $(this).next().slidedown(); } }); // 右侧滑动返回顶部 $('.kf .kf-side').click(function(){ //$('.kf').animate({ right: '-208' }, "slow"); var rt = $('.kf').css("right"); //alert(rt); var num = parseint(rt); //alert(num); if(num < 0){ $('.kf').animate({ right: '20px' }, "slow"); $('.kf .kf-side span.arrow').addclass('on'); }else{ $('.kf').animate({ right: '-208px' }, "slow"); $('.kf .kf-side span.arrow').removeclass('on'); } }); $('.kt-top span.close').click(function(){ $('.kf').animate({ right: '-208px' }, "slow"); }); $('.kf .backtop').click(function() { $("html,body").stop().animate({ scrolltop: '0' }, 500); }); }); function tabsswiper(menu, con) { var swiper = new swiper(con, { speed: 500, spacebetween: 10, on: { slidechangetransitionstart: function () { $(menu).find('li').eq(this.activeindex).addclass('active').siblings().removeclass('active'); } } }); $(menu).on('click', 'li', function (e) { $(this).addclass('active').siblings().removeclass('active'); swiper.slideto($(this).index()); }); }