From 6a4d3b7bbb462db62c4b38eb12c3f54f3fb85b56 Mon Sep 17 00:00:00 2001 From: zsun Date: Mon, 17 Jul 2023 17:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E5=8F=A4=E6=97=B6=E6=9C=9F=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=87=BD=E6=95=B0(=E8=8A=82=E9=80=89)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/util.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 js/util.js diff --git a/js/util.js b/js/util.js new file mode 100644 index 0000000..b821589 --- /dev/null +++ b/js/util.js @@ -0,0 +1,9 @@ +/** +* 上古时期的工具函数,可以理解为什么要定义这些函数,但是这个第一行`var D=document;`真是的是一言难尽! +*/ + +var D=document; +function $id(id){return typeof id==='string'?D.getElementById(id):id} +function $tag(el,tag){return $id(el).getElementsByTagName(tag)} +var getDocumentHeight=function(){return Math.max(D.documentElement.scrollHeight,D.documentElement.clientHeight)} +var isIE = (D.all) ? true : false; \ No newline at end of file -- Gitee