JS DOM Utils, browserify and selective require friendly
A set of DOM utilities, which were first created in
cog but have been extracted as cog
is more a JS language toolset, and
dd is it's DOM counterpart.
cog it is designed to be used as in a cherry-picking way rather
than by simply requiring
dd as a whole module.
The following is a list of modules that
dd provides. Examples demonstrate
require and use them in your code.
This is a simple script loader that will load the urls specified and trigger the callback once all those scripts have been loaded (or loading has failed in one instance).
var loader = require'dd/loader';var scripts ='//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/ace.js''//cdnjs.cloudflare.com/ajax/libs/chainvas/2.1/chainvas.js';loaderscriptsconsole.log'loaded';;
This function is used to get the results of the querySelectorAll output in the fastest possible way. This code is very much based on the implementation in zepto, but perhaps not quite as terse.
var qsa = require'dd/qsa';
Request animation frame helper.
var raf = require'dd/raf';console.log'animating';rafanimate; // go againrafanimate;