Code Monkey home page Code Monkey logo

tools.js's Introduction

tools.js

封装了一些常用的方法,并且对ES5新增的一些方法,做了兼容处理

1.圣杯继承 inherit

2.深度克隆 deepClone

3.判断数据类型 type

4.封装函数,返回元素e的第n个兄弟元素节点,n为正返回后面的兄弟元素节点, n为负返回前面的兄弟元素节点,n为0返回自己 retSinling

5.事件邦定,兼容各浏览器 addEvebt

6.事件移除,兼容各浏览器 removeEvent

7.获取样式 getStyle

8.阻止事件冒泡 stopBubble

9.阻止默认事件 cancelHandler

10.拖拽 drag

11.获取滚动条的位置 getScrollOffset

12.获取浏览器可视区的宽高 getViewportOffse

13.数组去重  unique

14.数组排序  mySort

15.indexOf 兼容

16.forEach 兼容

17.map 兼容

18.filter 兼容

19.some 兼容

20.every 兼容

21.查询字符串参数 getQueryStringArgus

tools.js's People

Contributors

y-king avatar y-queen avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.