/********************************** 璇存槑锛 * 搴旂敤瀵硅薄蹇呴』涓鸿垖绛炬寜閽殑鐩存帴鐖跺厓绱狅紝涓旂埗鍏冪礌鍐呬笉鍖呭惈鍏朵粬闈炴寜閽厓绱 * example: $( ".menus_wrap" ).tabso({ cntSelect:".content_wrap",tabEvent:"mouseover" }); * cntSelect:鍐呭鍧楃殑鐩存帴鐖跺厓绱犵殑 jq 閫夋嫨鍣 * tabEvent:瑙﹀彂浜嬩欢鍚 * tabStyle:鍒囨崲鏂瑰紡銆傚彲鍙栧€硷細"normal" "fade" "move" "move-fade" "move-animate" * direction:绉诲姩鏂瑰悜銆傚彲鍙栧€硷細"left" "top" 锛坱abStyle涓?move"鎴?move-fade" "move-animate"鏃舵湁鏁堬級 * aniMethod:鍔ㄧ敾鏂规硶锛堢壒娈婃晥鏋滈渶鎻掍欢锛堝锛歟asing锛夋敮鎸侊紝tabStyle涓?move-animate"鏃舵湁鏁堬級 * aniSpeed:鍔ㄧ敾閫熷害 * onStyle:鑿滃崟閫変腑鏍峰紡鍚 **********************************/ ;(function($){ $.fn.tabso=function( options ){ var opts=$.extend({},$.fn.tabso.defaults,options ); return this.each(function(i){ var _this=$(this); var $menus=_this.children( opts.menuChildSel ); var $container=$( opts.cntSelect ).eq(i); if( !$container) return; if( opts.tabStyle=="move"||opts.tabStyle=="move-fade"||opts.tabStyle=="move-animate" ){ var step=0; if( opts.direction=="left"){ step=$container.children().children( opts.cntChildSel ).outerWidth(true); }else{ step=$container.children().children( opts.cntChildSel ).outerHeight(true); } } if( opts.tabStyle=="move-animate" ){ var animateArgu=new Object(); } $menus[ opts.tabEvent]( function(){ var index=$menus.index( $(this) ); $( this).addClass( opts.onStyle ) .siblings().removeClass( opts.onStyle ); switch( opts.tabStyle ){ case "fade": if( !($container.children( opts.cntChildSel ).eq( index ).is(":animated")) ){ $container.children( opts.cntChildSel ).eq( index ).siblings().css( "display", "none") .end().stop( true, true ).fadeIn( opts.aniSpeed ); } break; case "move": $container.children( opts.cntChildSel ).css(opts.direction,-step*index+"px"); break; case "move-fade": if( $container.children( opts.cntChildSel ).css(opts.direction)==-step*index+"px" ) break; $container.children( opts.cntChildSel ).stop(true).css("opacity",0).css(opts.direction,-step*index+"px").animate( {"opacity":1},opts.aniSpeed ); break; case "move-animate": animateArgu[opts.direction]=-step*index+"px"; $container.children( opts.cntChildSel ).stop(true).animate( animateArgu,opts.aniSpeed,opts.aniMethod ); break; default: $container.children( opts.cntChildSel ).eq( index ).css( "display", "block") .siblings().css( "display","none" ); } }); $menus.eq(0)[ opts.tabEvent ](); }); }; $.fn.tabso.defaults={ cntSelect : ".content_wrap", tabEvent : "mouseover", tabStyle : "normal", direction : "top", aniMethod : "swing", aniSpeed : "fast", onStyle : "current", menuChildSel : "*", cntChildSel : "*" }; })(jQuery); /* countUp.js by @inorganik */ // target = id of html element or var of previously selected html element where counting occurs // startVal = the value you want to begin at // endVal = the value you want to arrive at // decimals = number of decimal places, default 0 // duration = duration of animation in seconds, default 2 // options = optional object of options (see below) var CountUp = function(target, startVal, endVal, decimals, duration, options) { // make sure requestAnimationFrame and cancelAnimationFrame are defined // polyfill for browsers without native support // by Opera engineer Erik M枚ller var lastTime = 0; var vendors = ['webkit', 'moz', 'ms', 'o']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; } if (!window.requestAnimationFrame) { window.requestAnimationFrame = function(callback, element) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; } if (!window.cancelAnimationFrame) { window.cancelAnimationFrame = function(id) { clearTimeout(id); }; } // default options this.options = { useEasing : true, // toggle easing useGrouping : true, // 1,000,000 vs 1000000 separator : ',', // character to use as a separator decimal : '.' // character to use as a decimal }; // extend default options with passed options object for (var key in options) { if (options.hasOwnProperty(key)) { this.options[key] = options[key]; } } if (this.options.separator === '') this.options.useGrouping = false; if (!this.options.prefix) this.options.prefix = ''; if (!this.options.suffix) this.options.suffix = ''; this.d = (typeof target === 'string') ? document.getElementById(target) : target; this.startVal = Number(startVal); this.endVal = Number(endVal); this.countDown = (this.startVal > this.endVal); this.frameVal = this.startVal; this.decimals = Math.max(0, decimals || 0); this.dec = Math.pow(10, this.decimals); this.duration = Number(duration) * 1000 || 2000; var self = this; this.version = function () { return '1.6.0'; }; // Print value to target this.printValue = function(value) { var result = (!isNaN(value)) ? self.formatNumber(value) : '--'; if (self.d.tagName == 'INPUT') { this.d.value = result; } else if (self.d.tagName == 'text' || self.d.tagName == 'tspan') { this.d.textContent = result; } else { this.d.innerHTML = result; } }; // Robert Penner's easeOutExpo this.easeOutExpo = function(t, b, c, d) { return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b; }; this.count = function(timestamp) { if (!self.startTime) self.startTime = timestamp; self.timestamp = timestamp; var progress = timestamp - self.startTime; self.remaining = self.duration - progress; // to ease or not to ease if (self.options.useEasing) { if (self.countDown) { self.frameVal = self.startVal - self.easeOutExpo(progress, 0, self.startVal - self.endVal, self.duration); } else { self.frameVal = self.easeOutExpo(progress, self.startVal, self.endVal - self.startVal, self.duration); } } else { if (self.countDown) { self.frameVal = self.startVal - ((self.startVal - self.endVal) * (progress / self.duration)); } else { self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration); } } // don't go past endVal since progress can exceed duration in the last frame if (self.countDown) { self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal; } else { self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal; } // decimal self.frameVal = Math.round(self.frameVal*self.dec)/self.dec; // format and print value self.printValue(self.frameVal); // whether to continue if (progress < self.duration) { self.rAF = requestAnimationFrame(self.count); } else { if (self.callback) self.callback(); } }; // start your animation this.start = function(callback) { self.callback = callback; self.rAF = requestAnimationFrame(self.count); return false; }; // toggles pause/resume animation this.pauseResume = function() { if (!self.paused) { self.paused = true; cancelAnimationFrame(self.rAF); } else { self.paused = false; delete self.startTime; self.duration = self.remaining; self.startVal = self.frameVal; requestAnimationFrame(self.count); } }; // reset to startVal so animation can be run again this.reset = function() { self.paused = false; delete self.startTime; self.startVal = startVal; cancelAnimationFrame(self.rAF); self.printValue(self.startVal); }; // pass a new endVal and start animation this.update = function (newEndVal) { cancelAnimationFrame(self.rAF); self.paused = false; delete self.startTime; self.startVal = self.frameVal; self.endVal = Number(newEndVal); self.countDown = (self.startVal > self.endVal); self.rAF = requestAnimationFrame(self.count); }; this.formatNumber = function(nStr) { nStr = nStr.toFixed(self.decimals); nStr += ''; var x, x1, x2, rgx; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? self.options.decimal + x[1] : ''; rgx = /(\d+)(\d{3})/; if (self.options.useGrouping) { while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + self.options.separator + '$2'); } } return self.options.prefix + x1 + x2 + self.options.suffix; }; // format startVal on initialization self.printValue(self.startVal); }; // Example: // var numAnim = new countUp("SomeElementYouWantToAnimate", 0, 99.99, 2, 2.5); // numAnim.start(); // numAnim.update(135); // with optional callback: // numAnim.start(someMethodToCallOnComplete); /*! Waypoints - 4.0.0 Copyright 婕 2011-2015 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); !function(t){"use strict";t.fn.countUp=function(e){var a=t.extend({time:2e3,delay:10},e);return this.each(function(){var e=t(this),n=a,u=function(){e.data("counterupTo")||e.data("counterupTo",e.text());var t=parseInt(e.data("counter-time"))>0?parseInt(e.data("counter-time")):n.time,a=parseInt(e.data("counter-delay"))>0?parseInt(e.data("counter-delay")):n.delay,u=t/a,r=e.data("counterupTo"),o=[r],c=/[0-9]+,[0-9]+/.test(r);r=r.replace(/,/g,"");for(var d=(/^[0-9]+$/.test(r),/^[0-9]+\.[0-9]+$/.test(r)),s=d?(r.split(".")[1]||[]).length:0,i=u;i>=1;i--){var p=parseInt(Math.round(r/u*i));if(d&&(p=parseFloat(r/u*i).toFixed(s)),c)for(;/(\d+)(\d{3})/.test(p.toString());)p=p.toString().replace(/(\d+)(\d{3})/,"$1,$2");o.unshift(p)}e.data("counterup-nums",o),e.text("0");var f=function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),a):(delete e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))};e.data("counterup-func",f),setTimeout(e.data("counterup-func"),a)};e.waypoint(u,{offset:"100%",triggerOnce:!0})})}}(jQuery);