1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
| ls[Math.floor(Math.random() * ls.length)]
toFixed(2)
isNaN()
e.target.tagName
DOMNodeInserted
e.stopPropagation();
e.preventDefault();
createElement();
appendChild();
insertBefore();
Array.prototype.slice.call()
function debounce(fn, delay = 200) { let timeout = null; return function(...args) { if (timeout) { clearTimeout(timeout); timeout = null; } timeout = setTimeout(() => { fn.apply(this, args) }, delay); } }
function throttle(fn, time = 300) { let pre = 0; let timeout = 0; return function(...args) { const now = Date.now(); if (now - pre > time) { pre = now; fn.apply(this, args); } else { if (timeout) { clearTimeout(timeout) timeout = null; } timeout = setTimeout(() => { pre = now; fn.apply(this, args); }, time); } } }
let system = "其他操作系统"; if (navigator.appVersion.indexOf("Win") != -1) system = "Windows"; if (navigator.appVersion.indexOf("Mac") != -1) system = "Mac"; if (navigator.appVersion.indexOf("Linux") != -1) system ="Linux"; if (navigator.appVersion.indexOf("Android") != -1) system = "Android"; if (navigator.appVersion.indexOf("like Mac") != -1) system = "iOS";
document.documentElement.scrollTop = window.pageYOffset
document.documentElement.clientHeight
document.body.clientWidth
document.body.clientHeight
document.body.offsetWidth (包括边线的宽)
document.body.offsetHeight (包括边线的高)
document.body.scrollWidth
document.body.scrollHeight
document.body.scrollTop
document.body.scrollLeft
window.screenTop
window.screenLeft
window.screen.height
window.screen.width
window.screen.availHeight
window.screen.availWidth
|