DollarJS
DollarJS copied to clipboard
A jQuery-compatible and non-All-in-One library which is more "Zepto" than Zepto.js
DollarJS
- A jQuery-compatible and non-All-in-One library which is more "Zepto" than Zepto.js
- Focus on DOM operations and mobile platform, wrap native API wherever possible.
For Android 2.x or ie9+ (beta)
define("dollar", ["dollar/android23"], function($){
return $;
});
For jQuery
define("dollar", ["dollar/jquery"], function($){
return $;
});
Usage
AMD and OzJS
- DollarJS can either be viewed as an independent library, or as a part of OzJS mirco-framework.
- It's wrapped as an AMD (Asynchronous Module Definition) module. You should use it with oz.js (or require.js or similar for handling dependencies).
- If you want to make it available for both other AMD code and traditional code based on global namespace. OzJS provides a mini define/require implementation to transform AMD module into traditional module pattern.
- See http://ozjs.org for details.
Get the code
Add to your project as new dependency
Or download directly from Github
Dependencies
Examples
Under construction...
API and usage
var $ = require('dollar');
$()--
API inherited from Array.prototype
- support all Array methods
API for traversing
find()--eq()--not()--matches()--has()--parent()--parents()--closest()--siblings()--next()--nextAll()--nextUntil()--prev()--prevAll()--prevUntil()--children()--contents()--
API for detection
is()--hasClass()--
API for properties
addClass()--removeClass()--toggleClass()--attr()--removeAttr()--prop()--removeProp()--data()--removeData()--val()--empty()--html()--text()--css()--hide()--show()--
API for dimensions
offset()--width()--height()--scrollLeft()--scrollTop()--
API for manipulation
appendTo()--append()--prependTo()--prepend()--insertBefore()--before()--insertAfter()--after()--replaceAll()--replaceWith()--wrap(boxes)--wrapAll()--wrapInner()--unwrap()--clone()--remove()--
API for event
one()--on()--off()--trigger()--
API for miscellaneous
end()--each()--
Public static API
$.matchesSelector | $.matches--$.contains--$.createNodes--$.camelize--$.dasherize--$.Event--
Why not add XXX
$.ajax()--$.when()--$.type()--$.isArray()--$.proxy()--$.extend()--$.fn.ready()--$.fn.animate()--$.fn.delegate()--$.fn.map()--$.fn.data(object)--$.fn.detach(object)--
Under construction...
More References
Release History
License
Copyright (c) 2010 - 2013 dexteryy
Licensed under the MIT license.