Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladocar/nanoJS
Minimal standalone JS library for DOM manipulation
https://github.com/vladocar/nanoJS
css dom dom-library dom-manipulation html javascript js library
Last synced: about 2 months ago
JSON representation
Minimal standalone JS library for DOM manipulation
- Host: GitHub
- URL: https://github.com/vladocar/nanoJS
- Owner: vladocar
- License: mit
- Created: 2018-05-20T11:50:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-04T12:43:53.000Z (almost 5 years ago)
- Last Synced: 2024-10-30T17:04:48.458Z (about 2 months ago)
- Topics: css, dom, dom-library, dom-manipulation, html, javascript, js, library
- Language: JavaScript
- Homepage: https://vladocar.github.io/nanoJS/
- Size: 2.57 MB
- Stars: 660
- Watchers: 23
- Forks: 39
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nanoJS
[![License MIT](https://img.shields.io/badge/licence-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)
[![Gzip Size](https://img.badgesize.io/https://unpkg.com/@vladocar/[email protected]/src/nanoJS.min.js?compression=gzip)](https://unpkg.com/@vladocar/[email protected]/src/nanoJS.min.js)
[![npm](https://img.shields.io/npm/v/@vladocar/nanojs.svg)](https://www.npmjs.com/package/@vladocar/nanojs)Minimal standalone JS library for DOM manipulation
nanoJS is around 100 lines of code (0.9 Kb compressed) JavaScript library for basic DOM manipulation. It has jQuery like syntax and supports chaining.
Syntax demos:
```javascript
$(".someClass").css("background-color:green;").html("Hello World");
$('#c').animate('2.3', '1.2','0','1','1','0','0', '0','0','1').css('background-color:red').text('Hello');
$("#a").on("click", function(){
$("#someDiv").css("background-color:green;color:#fff;");
})
```
[You can find it here some basic examples.](docs.md) also the [Mission & Philosophy of nanoJS](mission.md)
It works in IE9 and later. (some methods addClass, removeClass and toggleClass will not work in IE9)
Read more here:
[https://vladocar.github.io/nanoJS/](https://vladocar.github.io/nanoJS/)
or on my blog:
[http://www.vcarrer.com/2018/05/nanojs-javascript-for-dom-manipulation.html](http://www.vcarrer.com/2018/05/nanojs-javascript-for-dom-manipulation.html)
You can use direct download or:
```sh
npm i @vladocar/nanojs
``````sh
yarn add @vladocar/nanojs
``````html
OR
```
### Utils:
addClass
animate
attr
css
cssdom
empty
eq
getAttr
html
insertAfter, insertBefore, insertFirst insertLast
offset
on
parent
removeAttr
removeClass
siblings
text
toggleClass
log