0.0.5 • Published 4 years ago

yoctojs v0.0.5

Weekly downloads
61
License
MIT
Repository
github
Last release
4 years ago

YoctoJs

A light weight DOM utility library.

Try it

Fork me and run

> yarn buildev

then navigate to the example at http://127.0.0.1:3001
tune the code in the example (or the core) to see it live.

documentation (wip)

function Y

Y is the main function to be used as starter/ selector / constructor

var b = Y('body p');                            // get all paragraphs in the body (wrapped in Y)
var myNode = Y('<span>New paragraph</span>');   // creates a span tag (wrapped in Y)
Y(function () { console.log('ready'); });       // dom ready

or combine them adding an event handler and some styles

var s = Y('<span>Hello world</span>');
s.style({
    color:'red',
    'font-family': 'verdana'
}).on('click', function () {
    Y(this).style({color: 'green'});
}).once('click', function () {
    console.log('just once');
});
Y('body').append(s);

Better documentation will come asap, btw this is just an experiment ;)
0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.4

4 years ago

1.0.0

4 years ago