1// ãªã¹ããåå¾ 2const listElems = Array.from(document.getElementsByClassName('remove-last-margin-list')); 3let marginBottomNum = []; 4 5const getMarginBottom = (ulElem) => { 6 let liElems = Array.from(ulElem.children); 7 marginBottomNum.push(getComputedStyle(liElems[0]).getPropertyValue("margin-bottom")); 8} 9const marginBottom = () => { 10 listElems.forEach(listElem => { 11 getMarginBottom(listElem); 12 }); 13 14} 15window.addEventListener('load', marginBottom); 16 17// å ¥: HTMLè¦ç´ 18// åº: Yåº§æ¨æ°å¤ 19const getYPosition = (elem) => { 20 let clientRect = elem.getBoundingClientRect() ; 21 return window.pageYOffset + clientRect.top; 22} 23 24const removeLastLineMargin = (ulElem) => { 25 let liElems = Array.from(ulElem.children); 26 let liElemsYPotitions = liElems.map(getYPosition); 27 let uniqueliElemsYPotitions = Array.from(new Set(liElemsYPotitions)); 28 let lastRowYposition = uniqueliElemsYPotitions[uniqueliElemsYPotitions.length - 1 ]; 29 30 let lastRowLiElems = liElems.filter((elem) => { 31 return getYPosition(elem) == lastRowYposition; 32 }) 33 34 for (let i = 0; i < liElems.length; i++) { 35 liElems[i].style.marginBottom = ""; 36 } 37 38 for (let index = 0; index < lastRowLiElems.length; index++) { 39 lastRowLiElems[index].style.marginBottom = 0 + 'px'; 40 } 41 42} 43 44const removeMargins = () => { 45
46 listElems.forEach(listElem => { 47 removeLastLineMargin(listElem); 48 }); 49 50} 51window.addEventListener('load', removeMargins); 52window.addEventListener('resize', removeMargins);
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.