GithubHelp home page GithubHelp logo

dom7's Introduction

dom7

这是一个类jquery的dom操作库,包含3部分API。基本的dom操作,如attr,css,hasClass,append等api;事件相关API:on,off,trigger;以及Ajax。

来源

在最近开发公司的项目中,鉴于项目业务简单,采用jquery感觉显得有些重,另外为了锤炼下技术,就手写了这个类jquery的dom库。

特性

  • 整个库压缩后才9k;
  • 支持dom操作;
  • 支持事件绑定;
  • 支持ajax;
  • 支持插件拓展;

例子

事件绑定和解绑例子 https://jsfiddle.net/common/4wa0ag54/

分页插件编写例子 https://jsfiddle.net/common/qc3414r3/

说明

这个库暂时还有待进一步完善,由于是边做项目边写的,所以api设计上更符合我的项目要求,在通用性上有局限, 而我想传达的理念恰恰是“库的代码迎合项目够用就好”,这样可以缩小库的代码量,减少无关代码,更加轻量。

所以如果对这个库感兴趣,你不应该直接使用它,而是应该学习下源码并在此基础上改写,并更适合你的项目要求, 这并不太难。

使用的项目

汇聘官网

浏览器支持

IE9+,chrome,safari,firefox等。

dom7's People

Contributors

unnkoel avatar

Stargazers

 avatar

Watchers

 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.