Skip to content

RodRitter/kewjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KewJS

Lightweight alternative to jQuery selectors & basic utilities

Usage

  1. Include the library in your page <script src="path/to/kew.min.js"></script>

Documentation

$kew().ready()

Execute a callback when the DOM is ready.

Example

    $kew().ready(function(){
        // code to be executed after document has loaded
    });

$kew()

Select elements based on a CSS selector.

Example

    $kew('div');
    $kew('.foo div');
    $kew('#foo.bar');

$kew.each()

Execute a callback for each element.

Example

$kew('#foo').each(function(el) {
    console.log(el.innerHTML);
});

$kew.attr()

Adds an attribute to all selected elements.

Example

$kew('#foo').attr('data-custom', 'myValue');
// result: <div id="foo" data-custom="myValue"></div>

$kew.addClass()

Add a class to each selected elements.

Example

$kew('#foo').addClass('bar');

$kew.removeClass()

Remove a class from each selected elements.

Example

$kew('#foo').removeClass('bar');

$kew.removeElements()

Removes selected elements from the document.

$kew('#foo').removeElements();

Contributor Setup

If you would like to contribute and you will make modifications to kew.js, then you will need to make sure you have NodeJS to install. You can get it here.

C:\> cd path/to/project/kewjs
C:\path\to\project\kewjs> grunt
Running "uglify:build" (uglify) task

Done, without errors.

C:\path\to\project\kewjs>

About

Kew is a lightweight alternative to jQuery selectors.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published