Skip to content

stbaer/dom-inserted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dom-inserted

experimental

Listen for DOM node insertion, see detect-node-insertion

Usage

npm i dom-inserted

NPM

var domInserted = require('dom-inserted');

// Listen for elements that have a .inserted class
domInserted.listen();

// Listen for elements that have a .custom class
domInserted.listen('custom')

document.addEventListener('inserted', onInserted, false);

function onInserted(ev){
    // ev.detail contains: {animationName: ..., insertedElement: ...}
    var evDetail = ev.detail;
}

Standalone

You will need to have node setup on your machine.

Then you can install dependencies and build:

npm i && npm run build

That will output the built distributables to ./build.

Licence

MIT, see LICENSE.md for details.

About

Module to listen for DOM node insertion

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published