$(function () { var wow = new wow({ offset: 0, mobile: false }); wow.init(); $('.dropdown').hover(function () { $(this).addclass('open'); }, function () { $(this).removeclass('open'); }); $('.hform').find('form').submit(function () { var val = $(this).find('input').val(); if (!val) { alert('请输入关键字'); return false } }); $('.yunu-column').slide({ titcell: 'h3', targetcell: 'ul', defaultindex: 0, effect: 'slidedown', delaytime: 300, trigger: 'click' }).find('.sub').hover(function () { $(this).addclass('open').siblings().removeclass('open'); }, function () { $(this).removeclass('open'); }); // 右侧滑动返回顶部 var time; var $kefu = $('.kefu'); var $c = $kefu.find('#kefu'); $kefu.css({ 'margintop': -($kefu.height() / 2) }); $c.find('li').on({ 'mouseenter': function () { var scope = this; time = settimeout(function () { var divdom = $(scope).children('div'); var maxwidth = divdom.width(); $(scope).stop().animate({ left: 77 - maxwidth }, 'normal', function () { var pic = $(scope).find('.kefu-weixin-pic'); if (pic.length > 0) { pic.show(); } }); }, 100); }, 'mouseleave': function () { var pic = $(this).find('.kefu-weixin-pic'); if (pic.length > 0) { pic.hide(); } cleartimeout(time); $(this).stop().animate({ left: 0 }, 'normal', function () { }); } }); $(window).scroll(function () { var scrolltop = document.documentelement.scrolltop || window.pageyoffset || document.body.scrolltop; var eltop = $c.find('.kefu-ftop'); if (scrolltop > 0) { eltop.show(); } else { eltop.hide(); } }); $c.find('.kefu-ftop').click(function () { var scrolltop = document.documentelement.scrolltop || window.pageyoffset || document.body.scrolltop; if (scrolltop > 0) { $('html,body').animate({ scrolltop: 0 }, 'slow'); } }); });