@aamasri/popup
v2.0.8
Published
A flexible javascript popup.
Maintainers
Readme
- Download & copy this package's "dist" folder into your web server's public folder eg.
public/js/dist/*. - Rename "dist" to "popup" eg.
public/js/popup - Load the popup script at the end of your web page (before the closing
bodytag) like this:
<body>
...
<script src="/js/popup/popup.mjs"></script>
</body>
</html>
- When the browser loads, popup will be attached to the browser's global window object. Use it anywhere in your scripts like this:
<button>Target</button>
<script>
popup.open(); // Display the popup cheat sheet
...
popup.closeLast(); // close the on-top popup
...
popup.closeAll();
</script>Then import and use it in your project's ES6 modules:
function helloWorld() { popup.open({ title: 'Greetings', source: 'Hello World' }); }
popup.open(...});
window.setTimeout( function() {
popup.close(popupElement);
}, 10000);
});Popup supports npm under the name @aamasri/popup.
Publishing Updates
- Ananda Masri
- And awesome contributors
