(function(e){e.fn.tabs=function(t){var n={active:0,tit:"li",curclass:"current",trigger:"click"};var r=e.extend(n,t);return this.each(function(){function o(e){s.removeclass(r.curclass).eq(e).addclass(r.curclass);i.hide().eq(e).show()}var t=e(this);var n=t.attr("tab-tit");var i=e("[tab-con="+n+"]");var s=t.find(r.tit);s.bind(r.trigger,function(){o(s.index(this));return false});o(r.active)})}})(jquery) //滚动到…… function isscrolledintoview(o,r){o=$(o);var t=$(window),r=r||0,e=t.scrolltop(),i=e+t.height(),n=o.offset().top+r,f=n+o.height(),h=n>i;if(h)return!1;var l=f>e;return l?!(h&&l):!1} function gotop(ele){ $(ele).click(function(){ $("html, body").animate({ scrolltop: 0}); return false; }) } function slidenav(ele){ // #nav li $(ele).hover(function(){ $(this).find("dl").stop().slidetoggle(); $(this).toggleclass("current"); }); } $(window).scroll(function(){ if ($(this).scrolltop() > 800) { $('#menu').fadein(); } else { $('#menu').fadeout(); } }); //手机头部 jquery(document).ready(function($) { var m_menu = $('.m-nav'); $('.m-trigger').click(function(){ if( m_menu.is(':visible') ){ m_menu.hide(); }else{ m_menu.show(); } return false; }); /*$('.m-nav li a.v1').click(function(){ var sub = $(this).next('.m-sub'); if( sub.length > 0){ if( sub.is(':visible') ){ sub.hide(); }else{ $('.m-nav .m-sub').hide(); sub.css('display','inline-block'); } return false; }else{ return true; } })*/ }); //右侧边栏 $(document).ready(function(){ $(".side ul li").hover(function(){ $(this).find(".sidebox").stop().animate({"width":"190px"},200).css({"background":"#307bf8","padding-left":"8px"}) },function(){ $(this).find(".sidebox").stop().animate({"width":"50px"},200).css({"background":"rgba(48,123,248,1)","padding-left":"0"}) }); }); //回到顶部 function gotop(){ $('html,body').animate({'scrolltop':0},600); } $('.side2 li').hover(function(){ $(this).find('.weixin').stop().slidetoggle(); $(this).find('.douyin').stop().slidetoggle(); }) // 选项卡 鼠标点击 $(".tab_click li").click(function(){ var tab=$(this).parent(".tab_click"); var con=tab.attr("id"); var on=tab.find("li").index(this); $(this).addclass('hover').siblings(tab.find("li")).removeclass('hover'); $(con).eq(on).show().siblings(con).hide(); }); $(window).scroll(function(){ if( $('.ul-show').length > 0 ){ if(isscrolledintoview('.ul-show') ){ moveabout(); } } }).scroll(); function moveabout(){ $('.ul-show li').each(function(){ $(this).find('img').each(function(i){ $(this).delay(i*500).animate({opacity:1}); }) }) } !function ($) { var before = 0, after = 0; $.scrolltoggle = function (callbackup, callbackdown, callback) { $(window).scroll(function () { callback && callback(); after = $(this).scrolltop(); after <= before ? callbackup() : callbackdown(); before = after; }) } }(jquery); /* $(document).ready(function(){ var debounce = function(fn, delay) { var timeout; return function() { var self = this; var args = arguments; window.cleartimeout(timeout); timeout = window.settimeout(function() { fn.apply(self, args); }, delay); }; }; var shows = debounce(function(){ $('#hd').stop(true,true).slidedown(200); },300); var hides = debounce(function(){ $('#hd').stop(true,true).slideup(200); },300); var lastscrolltop = 0; $(window).scroll(function(event){ if( $('#m-hd').is(':visible') ){ return; } var st = $(this).scrolltop(); if (st > lastscrolltop){ hides(); } else { shows(); } lastscrolltop = st; }); })*/ $('#fd .weixin').hover(function(){ $(this).parents('dd').find('.weixin-pic').stop().slidetoggle(); }) $(document).ready(function(){ (function($) { var ost = 0; $(window).scroll(function() { var cost = $(this).scrolltop(); $("#hd").addclass("fixed"); if(cost > 100 && cost > ost) { $('#hd').addclass('fixed').removeclass('default'); } else { $('#hd').addclass('default').removeclass('fixed'); } ost = cost; }); })(jquery); }) $(document).ready(function(){ $('#floatbar li').hover(function() { if( $(this).find('.pop').length ){ $(this).addclass('on').find('.pop').show(); } },function(){ if( $(this).find('.pop').length ){ $(this).removeclass('on').find('.pop').hide(); } }); })