jshit
The last library for dirty DOM manipulations if you can avoid that.
Last updated 5 years ago by kchan .
MIT · Original npm · Tarball · package.json
$ cnpm install jshit 
SYNC missed versions from official npm registry.

jShit

???? WIP. The last library for dirty DOM manipulations if you can avoid that.

Install

First:

npm install jshit --save

Then:

// using CommonJS and Webpack with babel-loader
import { $, $$, dom } from 'jshit'

// loaded directly from CDN
// $/$$/dom ... will be automatically exposed as global vars.

API

Selector

// for a single dom element
$('elmement')

// for a dom array
$$('elemements')

// remember that $/$$ is just a shorthand
// for document.querySelector/querySelectorAll

Search

// .find is a short hand for querySelectors in its parent element
// it works for `dom` function set globally by jShit
var el = dom($('element'))
el.find('li')
// return something like : DOM {el: NodeList[5]}
// which is your `li` array

Loop

// if you got a dom array using $$
// for using dom.find() method
// you can iterate over each dom element
var els = dom($('element')).find('li')
els.each(function (el, index) {
  console.log(el, index)
})

License

MIT.

Current Tags

  • 0.0.1                                ...           latest (5 years ago)

1 Versions

  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (0)
None
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |