element-pants
Advanced tools
Comparing version 0.1.1 to 0.2.0
13
index.js
@@ -160,3 +160,3 @@ ;(function() { | ||
* | ||
* Shows the element. The | ||
* Shows the element. | ||
**/ | ||
@@ -169,2 +169,12 @@ function show() { | ||
/** | ||
* Element#remove() -> Element | ||
* | ||
* Removes the element from the DOM. | ||
**/ | ||
function remove() { | ||
if (this.parentNode) this.parentNode.removeChild(this); | ||
return this; | ||
} | ||
/** | ||
* Element#find(selector) -> Element | ||
@@ -330,2 +340,3 @@ * - selector (String): CSS Selector | ||
show: show, | ||
remove: remove, | ||
find: find, | ||
@@ -332,0 +343,0 @@ findAll: findAll, |
{ | ||
"name" : "element-pants", | ||
"description" : "Some pants for your elements.", | ||
"version" : "0.1.1", | ||
"version" : "0.2.0", | ||
"homepage" : "http://github.com/dandean/element-pants", | ||
@@ -6,0 +6,0 @@ "author" : "Dan Dean <me@dandean.com> (http://dandean.com)", |
Element Pants | ||
================================================================================ | ||
**Element Pants** can extend the DOM Element API, making it easier to use. You may find this offensive... luckily I don't care about your feelings on the matter. | ||
**Element Pants** provides functions for working with the DOM in all of the usual ways. Element Pants is not limited to HTML document manipulation, and even handles XML and SVG just fine. | ||
One benefit of Element Pants, depending on your perspective, is that it doesn't bother supporting older browsers. In fact, it hasn't even been tested in older versions of IE, because fuck that shit. We've got a nice pool here - let's not poop in it. | ||
If you call the `install` function, Element Pants will install itself on Element prototypes so that it extends the DOM Element API, making it easier to use. You may find this offensive... luckily I don't care about your feelings on the matter. | ||
API | ||
-------------------------------------------------------------------------------- | ||
`hasClass`, `addClass`, `removeClass`, `toggleClass`, `getStyle`, `setStyle`, `hide`, `show`, `remove`, `find`, `findAll`, `on`, `off`, `create`, `install` | ||
Documentation | ||
-------------------------------------------------------------------------------- | ||
Read index.js. | ||
Should I Use This? | ||
-------------------------------------------------------------------------------- | ||
Not in its current form, but at some point it will become useful. | ||
Yes. | ||
Installation | ||
-------------------------------------------------------------------------------- | ||
Grab a copy of the source, and require it in your app: | ||
Element Pants if available via NPM and Bower, and works great as a CommonJS module, RequireJS module or even a regular old `<script>` include. | ||
require("./path/to/element-pants").install(); | ||
Or install it with NPM: | ||
Licence | ||
-------------------------------------------------------------------------------- | ||
$ npm install element-pants | ||
Then require it in your app: | ||
require("element-pants").install(); | ||
MIT |
135020
13
3149
39