1$(function () { 2 const getScrollContainer = () => $('html, body'); 3 4 function scrollToElement(selector, call) { 5 let navbarHeight = 0; 6 if ($(window).width() > 767) { 7 navbarHeight = $('#navbar').outerHeight() || 0; 8 } 9 10 const $el = $(selector).first(); 11 if (!$el.length) return; 12 13 // å æ»å°é¡¶é¨ï¼ç 50ms 让 DOM éæ°åæµï¼åæ»ç®æ ä½ç½® 14 $('html, body').stop(true).scrollTop(0); 15 16 setTimeout(() => { 17 const top = $el.offset().top; 18 $('html, body').stop(true).animate({ 19 scrollTop: top - navbarHeight 20 }, 300, function () { 21 call() 22 }); 23 }, 50); 24 } 25 26 // 置顶 27 $('.icon-top-unselect').click(() => { 28 getScrollContainer().stop(true).animate({ scrollTop: 0 }, 300, function () { 29 $('.icon-top-select').removeClass('icon-top-select').addClass('icon-top-unselect'); 30 }); 31 $('.icon-top-unselect').removeClass('icon-top-unselect').addClass('icon-top-select'); 32 }); 33 34 // æ£æ 35 $('.icon-content-unselect').click(() => { 36 scrollToElement('.post-content > p', () => { 37 $('.icon-content-select').removeClass('icon-content-select').addClass('icon-content-unselect'); 38 }); 39 $('.icon-content-unselect').removeClass('icon-content-unselect').addClass('icon-content-select'); 40 }); 41 42 // è§é¢ 43 $('.icon-video-unselect').click(() => { 44 scrollToElement('.post-content > .vodplayer-container', () => { 45 $('.icon-video-select').removeClass('icon-video-select').addClass('icon-video-unselect'); 46 }); 47 $('.icon-video-unselect').removeClass('icon-video-unselect').addClass('icon-video-select'); 48 }); 49 50 // è¯è®º 51 $('.icon-comment-unselect').click(() => { 52 scrollToElement('#comments', () => { 53 $('.icon-comment-select').removeClass('icon-comment-select').addClass('icon-comment-unselect'); 54 }); 55 $('.icon-comment-unselect').removeClass('icon-comment-unselect').addClass('icon-comment-select'); 56 }); 57 58});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.