A 5k Javascript library for selecting, styling, traversing and animating DOM elements.
MIT License
5k Javascript library for selecting, styling, traversing and animating DOM elements.
$dom was coded by Keith Clark and was once available at http://www.keithclark.co.uk/$dom/
(no longer active).
The project is currently in maintainance mode. No new code is currently developed. However, since the library was developed with standards in mind, it's future-compatible and should work in all current browsers.
dollardom.js
is always the most up to date version. I consider that it
is pretty good quality, which means that I still find bugs myself, but
that I feel it can be used on real web sites or web applications. Please
report any bug you find.
I'll try to keep dollardom.min.js
(minified with uglifyjs
) in sync but
take attention to the timestamp to be sure.
If you want animation support, include either both dollardom.js
and animate.js
or their concatened/minified version dollardom-animate.min.js
.
Please note however that nowadays, you should consider doing simple
animations with CSS transitions. For your more complex needs you can also
have a look to SVG.
If you want try the new jQuery-like simpler chaining API, you can use
dollardom-chain.min.js
or dollardom-chain-animate.min.js
instead.
Since it is newer than the normal API, it
could have some bugs. Please consider this syntax beta-quality.
A debug version is also available: dollardom-full.debug.js
. Using this
version during development makes you certain you use dollardom
correctly, because otherwise you'll get exceptions.
Please note that this version is not yet finished and some
$dom functions are not checked yet.
I used $dom in a project and wanted to fix one bug. Moreover Keith Clark stopped maintaining this code and I felt it is still useful nowadays.
I asked him where I could find the original source code (since only the minified/obfuscated code was available on his website) and he kindly sent it to me.
That's right. For big projects, you can use jQuery, Dojo, ExtJS, Mootools, etc. For mobile projects, there are jQuery Mobile, jqtouch, Sencha touch, Zepto.js, xui.js. But please read further.
$dom features the following strong points:
$("<div id='myDiv' class='class1 class2'>"); // jQuery
with
$dom.create("div#myDiv.class1.class2"); // $dom.
forEach
, map
, reduce
, etc.) or Ajax. There are perfectlyIt has also of course some weak points, because we can't have it all:
em
.ender.js could be a good alternative with its modular approach. One of our goals is to integrate better with this tool.
The build script needs uglifyjs and node.
On Debian-like systems, these could most probably be installed with the command :
aptitude install libnode-uglify
transform
queueable