|
|
@@ -0,0 +1,104 @@
|
|
|
+# utils
|
|
|
+
|
|
|
+### Array
|
|
|
+####   [arrayEqual][arrayEqual]  判断两个数组是否相等
|
|
|
+
|
|
|
+### Class
|
|
|
+####   [addClass][addClass]  为元素添加class
|
|
|
+####   [hasClass][hasClass]  判断元素是否有某个class
|
|
|
+####   [removeClass][removeClass]  为元素移除class
|
|
|
+
|
|
|
+### Cookie
|
|
|
+####   [getCookie][getCookie]  根据name读取Cookie
|
|
|
+####   [removeCookie][removeCookie]  根据name删除Cookie
|
|
|
+####   [setCookie][setCookie]  添加Cookie
|
|
|
+
|
|
|
+### Device
|
|
|
+####   [getExplore][getExplore]  获取浏览器类型和版本号
|
|
|
+####   [getOS][getOS]  获取操作系统类型
|
|
|
+
|
|
|
+### Dom
|
|
|
+####   [getScrollTop][getScrollTop]  获取滚动条距顶部的距离
|
|
|
+####   [offset][offset]  获取一个元素的距离文档(document)的位置,类似jQ中的offset()
|
|
|
+####   [scrollTo][scrollTo]  在${duration}时间内,滚动条平滑滚动到${to}指定位置
|
|
|
+####   [setScrollTop][setScrollTop]  设置滚动条距顶部的距离
|
|
|
+
|
|
|
+### Function
|
|
|
+####   [debounce][debounce]  函数防抖
|
|
|
+####   [throttle][throttle]  函数节流
|
|
|
+
|
|
|
+### Keycode
|
|
|
+####   [getKeyName][getKeyName]  根据keycode获得键名
|
|
|
+
|
|
|
+### Object
|
|
|
+####   [deepClone][deepClone]  深拷贝,支持常见类型
|
|
|
+####   [isEmptyObject][isEmptyObject]  判断Object是否为空
|
|
|
+
|
|
|
+### Random
|
|
|
+####   [randomColor][randomColor]   随机生成颜色
|
|
|
+####   [randomNum][randomNum]  生成指定范围随机数
|
|
|
+
|
|
|
+### Regexp
|
|
|
+####   [isEmail][isEmail]  判断是否为邮箱地址
|
|
|
+####   [isIdCard][isIdCard]  判断是否为身份证号
|
|
|
+####   [isPhoneNum][isPhoneNum]  判断是否为手机号
|
|
|
+####   [isUrl][isUrl]  判断是否为URL地址
|
|
|
+
|
|
|
+### String
|
|
|
+####   [digitUppercase][digitUppercase]  现金额转大写
|
|
|
+
|
|
|
+### Support
|
|
|
+####   [isSupportWebP][isSupportWebP]  判断浏览器是否支持webP格式图片
|
|
|
+####
|
|
|
+
|
|
|
+### Time
|
|
|
+####   [formatPassTime][formatPassTime]  格式化${startTime}距现在的已过时间
|
|
|
+####   [formatRemainTime][formatRemainTime]  格式化现在距${endTime}的剩余时间
|
|
|
+
|
|
|
+### Url
|
|
|
+####   [parseQueryString][parseQueryString]  url参数转对象
|
|
|
+####   [stringfyQueryString][stringfyQueryString]  对象序列化
|
|
|
+
|
|
|
+[arrayEqual]:https://github.com/striveDJiang/utils/array/arrayEqual.js
|
|
|
+
|
|
|
+[addClass]:https://github.com/striveDJiang/utils/class/addClass.js
|
|
|
+[hasClass]:https://github.com/striveDJiang/utils/class/hasClass.js
|
|
|
+[removeClass]:https://github.com/striveDJiang/utils/class/removeClass.js
|
|
|
+
|
|
|
+[getCookie]:https://github.com/striveDJiang/utils/cookie/getCookie.js
|
|
|
+[removeCookie]:https://github.com/striveDJiang/utils/cookie/removeCookie.js
|
|
|
+[setCookie]:https://github.com/striveDJiang/utils/cookie/setCookie.js
|
|
|
+
|
|
|
+[getExplore]:https://github.com/striveDJiang/utils/device/getExplore.js
|
|
|
+[getOS]:https://github.com/striveDJiang/utils/device/getOS.js
|
|
|
+
|
|
|
+[getScrollTop]:https://github.com/striveDJiang/utils/dom/getScrollTop.js
|
|
|
+[offset]:https://github.com/striveDJiang/utils/dom/offset.js
|
|
|
+[scrollTo]:https://github.com/striveDJiang/utils/dom/scrollTo.js
|
|
|
+[setScrollTop]:https://github.com/striveDJiang/utils/dom/setScrollTop.js
|
|
|
+
|
|
|
+[debounce]:https://github.com/striveDJiang/utils/function/debounce.js
|
|
|
+[throttle]:https://github.com/striveDJiang/utils/function/throttle.js
|
|
|
+
|
|
|
+[getKeyName]:https://github.com/striveDJiang/utils/keycode/getKeyName.js
|
|
|
+
|
|
|
+[deepClone]:https://github.com/striveDJiang/utils/object/deepClone.js
|
|
|
+[isEmptyObject]:https://github.com/striveDJiang/utils/object/isEmptyObject.js
|
|
|
+
|
|
|
+[randomColor]:https://github.com/striveDJiang/utils/random/randomColor.js
|
|
|
+[randomNum]:https://github.com/striveDJiang/utils/random/randomNum.js
|
|
|
+
|
|
|
+[isEmail]:https://github.com/striveDJiang/utils/regexp/isEmail.js
|
|
|
+[isIdCard]:https://github.com/striveDJiang/utils/regexp/isIdCard.js
|
|
|
+[isPhoneNum]:https://github.com/striveDJiang/utils/regexp/isPhoneNum.js
|
|
|
+[isUrl]:https://github.com/striveDJiang/utils/regexp/isUrl.js
|
|
|
+
|
|
|
+[digitUppercase]:https://github.com/striveDJiang/utils/string/digitUppercase.js
|
|
|
+
|
|
|
+[isSupportWebP]:https://github.com/striveDJiang/utils/support/isSupportWebP.js
|
|
|
+
|
|
|
+[formatPassTime]:https://github.com/striveDJiang/utils/time/formatPassTime.js
|
|
|
+[formatRemainTime]:https://github.com/striveDJiang/utils/time/formatRemainTime.js
|
|
|
+
|
|
|
+[parseQueryString]:https://github.com/striveDJiang/utils/url/parseQueryString.js
|
|
|
+[stringfyQueryString]:https://github.com/striveDJiang/utils/url/stringfyQueryString.js
|