Skip to content

Instantly share code, notes, and snippets.

@neopunisher
Created May 23, 2018 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neopunisher/14459477e74ecbd46318ca79fa7cdb9b to your computer and use it in GitHub Desktop.
Save neopunisher/14459477e74ecbd46318ca79fa7cdb9b to your computer and use it in GitHub Desktop.
does stuff when things are added to the page... via https://github.com/muicss/sentineljs
(function(style, func){
document.addEventListener('sentinel-load', function(){
sentinel.on(style, func);
})
var a=document.createElement("script");a.src='//cdn.rawgit.com/muicss/sentineljs/0.0.4/dist/sentinel.min.js';a.type="text/javascript";
document.head.appendChild(a);
})('.my-div', function(el) {
el.innerHTML = 'The sentinel is always watching.';
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment