|
| 1 | +var UrlAll = null; |
| 2 | + |
| 3 | +var Main = {}; |
| 4 | + |
| 5 | +Main = { |
| 6 | + init: function(){ |
| 7 | + // Avoid `console` errors in browsers that lack a console. |
| 8 | + (function() { |
| 9 | + var method; |
| 10 | + var noop = function () {}; |
| 11 | + var methods = [ |
| 12 | + 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', |
| 13 | + 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', |
| 14 | + 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', |
| 15 | + 'timeStamp', 'trace', 'warn' |
| 16 | + ]; |
| 17 | + |
| 18 | + var length = methods.length; |
| 19 | + var console = (window.console = window.console || {}); |
| 20 | + |
| 21 | + while (length--) { |
| 22 | + method = methods[length]; |
| 23 | + |
| 24 | + // Only stub undefined methods. |
| 25 | + if (!console[method]) { |
| 26 | + console[method] = noop; |
| 27 | + } |
| 28 | + } |
| 29 | + }()); |
| 30 | + |
| 31 | + $.easing['jswing'] = $.easing['swing']; |
| 32 | + |
| 33 | + $.extend($.easing, { |
| 34 | + def: 'easeOutQuad', |
| 35 | + easeInOutExpo: function (x, t, b, c, d) { |
| 36 | + if (t==0) return b; |
| 37 | + if (t==d) return b+c; |
| 38 | + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; |
| 39 | + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; |
| 40 | + } |
| 41 | + }); |
| 42 | + |
| 43 | + $('*[data-autoscroll]').click(function(){ |
| 44 | + var target = $(this.hash); |
| 45 | + |
| 46 | + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); |
| 47 | + |
| 48 | + if (target.length) { |
| 49 | + $('html,body').animate({ scrollTop: target.offset().top }, 1500, 'easeInOutExpo'); |
| 50 | + return false; |
| 51 | + } |
| 52 | + }); |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +$(document).ready(function() { |
| 57 | + Main.init(); |
| 58 | +}); |
0 commit comments