GithubHelp home page GithubHelp logo

hhy5277 / domq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nzbin/domq

0.0 1.0 0.0 449 KB

๐Ÿ› ๏ธ A modular DOM manipulation library.

Home Page: https://nzbin.gitbooks.io/domq-api/

License: MIT License

JavaScript 100.00%

domq's Introduction

Domq

npm license

Domq is a modular DOM manipulation library. It's built according to Zepto.js.

Installation

$ npm install domq.js --save

There have four files in dist after build.

dist
โ”œโ”€โ”€ domq.js (UMD)
โ”œโ”€โ”€ domq.common.js (CJS)
โ”œโ”€โ”€ domq.esm.js (ESM)
โ””โ”€โ”€ domq.modular.js (MODULAR)

It's used domq.modular.js by default.

import { D } from 'domq.js'

Or you can also import the other file as needed.

import { D } from 'domq.js/dist/domq.esm.js'

Modular Usage

You should put the methods as needed on D function manually.

import {
  D,
  isArray,
  addClass
} from 'domq.js/src/domq.modular';

// Static methods
const methods = {
  isArray
}

// Instance methods
const fnMethods = {
  addClass
}

D.extend(methods);
D.fn.extend(fnMethods);

Instance methods

The methods as below is optional.

D().css()
D().attr()
D().removeAttr()
D().prop()
D().removeProp()
D().hasClass()
D().addClass()
D().removeClass()
D().toggleClass()
D().width()
D().height()
D().offset()
D().position()
D().scrollTop()
D().scrollLeft()
D().offsetParent()
D().remove()
D().empty()
D().clone()
D().html()
D().text()
D().append()
D().prepend()
D().after()
D().before()
D().replaceWith()
D().appendTo()
D().prependTo()
D().insertAfter()
D().insertBefore()
D().replaceAll()
D().find()
D().filter()
D().has()
D().not()
D().is()
D().add()
D().contents()
D().closest()
D().parents()
D().parent()
D().children()
D().siblings()
D().prev()
D().next()
D().index()
D().wrap()
D().wrapAll()
D().wrapInner()
D().unwrap()
D().val()
D().one()
D().on()
D().off()
D().trigger()
D().triggerHandler()
D().animate()
D().anim()
D().show()
D().hide()
D().toggle()
D().fadeTo()
D().fadeIn()
D().fadeOut()
D().fadeToggle()

Static methods

The methods as below is optional.

D.type()
D.contains()
D.camelCase()
D.isFunction()
D.isWindow()
D.isEmptyObject()
D.isPlainObject()
D.isNumeric()
D.isArray()
D.inArray()
D.trim()
D.grep()
D.noop()
D.Event()
D.proxy()

domq's People

Contributors

nzbin avatar

Watchers

 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.