//by 470502424 (function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else { factory(jQuery); } }(function ($) { var W = $.w = $.w || {}; $.some = $.some || function (ary, func) { if (!$.isArray(ary)) return false; var i = 0; for (; i < ary.length; ++i) if (func.call(ary[i], i, ary[i])) return true; return false; }; if (!Function.prototype.bind) { Function.prototype.bind = function (oThis) { if (typeof this !== 'function') { // closest thing possible to the ECMAScript 5 // internal IsCallable function throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP ? this : oThis, // 获取调用时(fBound)的传参.bind 返回的函数入参往往是这么传递的 aArgs.concat(Array.prototype.slice.call(arguments))); }; // 维护原型关系 if (this.prototype) { // Function.prototype doesn't have a prototype property fNOP.prototype = this.prototype; } fBound.prototype = new fNOP(); return fBound; }; } //percent, duration * percent, 0, 1, duration $.extend($.easing, { def: 'easeOutQuad', easeInQuad: function (x, t, b, c, d) { return c * (t /= d) * t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c * (t /= d) * (t - 2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t + b; return -c / 2 * ((--t) * (t - 2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c * (t /= d) * t * t + b; }, easeOutCubic: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; return c / 2 * ((t -= 2) * t * t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c * (t /= d) * t * t * t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 * ((t -= 2) * t * t * t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b; }, easeOutQuint: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t == 0) return b; if (t == d) return b + c; if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; }, easeOutElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5); if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b; } }); W.navigator = (function () { var ua = navigator.userAgent, isIE = (isIE = ua.match(/msie (\d+)/i)) ? ~~isIE[1] : false, //!IE11 Mozilla,Gecko isWindowsPhone = /(?:Windows Phone)/.test(ua), isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone, isAndroid = /(?:Android)/.test(ua), isFireFox = /(?:Firefox)/.test(ua), isChrome = /(?:Chrome|CriOS)/.test(ua), isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)), isPhone = /(?:iPhone)/.test(ua) && !isTablet, isPc = !isPhone && !isAndroid && !isSymbian; return { isTablet: isTablet, isPhone: isPhone, isFireFox: isFireFox, isChrome: isChrome, isAndroid: isAndroid, isPc: isPc, isIE: isIE }; })(); W.css33dTransformSupported = document.documentElement.style.animation != void 0; $.extend(W, { easing2cubicBezier: function (s) { return { linear: 'cubic-bezier(0, 0, 1, 1)', swing: 'ease-in-out', easeInSine: 'cubic-bezier(0.47, 0, 0.745, 0.715)', easeOutSine: 'cubic-bezier(0.39, 0.575, 0.565, 1)', easeInOutSine: 'cubic-bezier(0.445, 0.05, 0.55, 0.95)', easeInQuad: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)', easeOutQuad: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', easeInOutQuad: 'cubic-bezier(0.455, 0.03, 0.515, 0.955)', easeInCubic: 'cubic-bezier(0.55, 0.055, 0.675, 0.19)', easeOutCubic: 'cubic-bezier(0.215, 0.61, 0.355, 1)', easeInOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1)', easeInQuart: 'cubic-bezier(0.895, 0.03, 0.685, 0.22)', easeOutQuart: 'cubic-bezier(0.165, 0.84, 0.44, 1)', easeInOutQuart: 'cubic-bezier(0.77, 0, 0.175, 1)', easeInQuint: 'cubic-bezier(0.755, 0.05, 0.855, 0.06)', easeOutQuint: 'cubic-bezier(0.23, 1, 0.32, 1)', easeInOutQuint: 'cubic-bezier(0.86, 0, 0.07, 1)', easeInExpo: 'cubic-bezier(0.95, 0.05, 0.795, 0.035)', easeOutExpo: 'cubic-bezier(0.19, 1, 0.22, 1)', easeInOutExpo: 'cubic-bezier(1, 0, 0, 1)', easeInCirc: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)', easeOutCirc: 'cubic-bezier(0.075, 0.82, 0.165, 1)', easeInOutCirc: 'cubic-bezier(0.785, 0.135, 0.15, 0.86)', easeInBack: 'cubic-bezier(0.6, -0.28, 0.735, 0.045)', easeOutBack: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)', easeInOutBack: 'cubic-bezier(0.68, -0.55, 0.265, 1.55)' }[s] || 'ease-in-out'; }, parseJSON: function (str) { var data; try { data = $.parseJSON(str); } catch (e) { return false; } return data; }, //颜色 toColor: function (r, g, b) { var i = 0, n, ret = '#'; for (; i < 3; ++i) { n = Math.min(parseInt(arguments[i]) || 0, 255).toString(16); if (n.length < 2) n = '0' + n; ret += n; } return ret; }, //返回#ffffff randomColor: function () { return $.w.toColor(Math.ceil(Math.random() * 256), Math.ceil(Math.random() * 256), Math.ceil(Math.random() * 256) ); }, //ie6 png添加滤镜 blankGifPath: 'images/blank.gif', pngfix: function (e, mode) { if (!this.navigator.isIE || this.navigator.isIE != 6) { return; } var mode = mode || 'scale', es = e.style; isImg = $.nodeName(e, 'img'), path = isImg ? e.src : e.currentStyle.backgroundImage.split('"')[1]; if (!/\.png$/.test(path)) return; if (isImg) { e.width = e.width; e.height = e.height; e.src = $.w.blankGifPath; } es.backgroundImage = 'none'; es.filter = e.currentStyle.filter + ' progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + path + '\',sizingMethod=' + mode + ')'; }, //旋转 rotation: function () { var f = W.navigator.isIE && W.navigator.isIE < 9 ? function (elem, deg) { var deg2radians = Math.PI * 2 / 360; var rad = deg * deg2radians; var costheta = Math.cos(rad); var sintheta = Math.sin(rad); elem.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(SizingMethod = \'auto expand\',' + 'M11 =' + costheta + ',M12 =' + -sintheta + ',M21 =' + sintheta + ',M22 =' + costheta + ')'; } : function (elem, deg) { elem.style['transform'] = 'rotate(' + deg + 'deg)'; }; return function (elems, deg) { $(elems).each(function () { f(this, deg); }); }; }(), //模拟ajax post 用于服务器不支持ajax的情况 post: function (url, data, callback) { if ($.isFunction(data)) { callback = data; data = null; } var iframe = $('