diff --git a/assets/js/joe.global.js b/assets/js/joe.global.js index 554548a..01a3679 100644 --- a/assets/js/joe.global.js +++ b/assets/js/joe.global.js @@ -1,7 +1,6 @@ window.Joe = function () { /* 请求基准URL */ const BASE_API = '/index.php/joe/api'; - /* 头部高度 */ const Header_Height = $('.joe_header').height(); @@ -224,7 +223,7 @@ window.Joe = function () { length = $('.joe_index__list .joe_list .joe_list__item').length - length; const queryElement = `.joe_index__list .joe_list .joe_list__item:nth-child(${length})`; const offset = $(queryElement).offset().top - Header_Height; - window.scroll({ top: offset - 15, behavior: 'smooth' }); + window.scrollTo({ top: offset - 15, behavior: 'smooth' }); }); } diff --git a/assets/js/joe.scroll.js b/assets/js/joe.scroll.js new file mode 100644 index 0000000..1bb0248 --- /dev/null +++ b/assets/js/joe.scroll.js @@ -0,0 +1 @@ +"use strict";function polyfill(){function o(o){var t=["MSIE ","Trident/","Edge/"];return new RegExp(t.join("|")).test(o)}function t(o,t){this.scrollLeft=o,this.scrollTop=t}function e(o){return.5*(1-Math.cos(Math.PI*o))}function l(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function r(o,t){return"Y"===t?o.clientHeight+b1?1:n,t=e(n),l=o.startX+(o.x-o.startX)*t,r=o.startY+(o.y-o.startY)*t,o.method.call(o.scrollable,l,r),l===o.x&&r===o.y||u.requestAnimationFrame(s.bind(u,o))}function a(o,e,l){var r,i,n,c,a=y();o===m.body?(r=u,i=u.scrollX||u.pageXOffset,n=u.scrollY||u.pageYOffset,c=w.scroll):(r=o,i=o.scrollLeft,n=o.scrollTop,c=t),s({scrollable:r,method:c,startTime:a,startX:i,startY:n,x:e,y:l})}for(var f=0,p=["ms","moz","webkit","o"],d=0;d + - \ No newline at end of file + + \ No newline at end of file