- ` + body.innerHTML;
+ `);
Alpine.store("lightbox", {
show: false,
src: null,
diff --git a/package.json b/package.json
index c99d729..62b1b23 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@edsardio/alpine-lightbox",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "A dynamic lightbox using AlpineJS and TailwindCSS",
"main": "dist/module.cjs.js",
"module": "dist/module.esm.js",
diff --git a/src/index.js b/src/index.js
index ff28964..cdcdd74 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,7 +1,7 @@
export default function (Alpine) {
document.addEventListener('alpine:init', () => {
let body = document.querySelector('body');
- body.innerHTML = `
+ body.insertAdjacentHTML('afterbegin', `
- ` + body.innerHTML;
+ `);
Alpine.store('lightbox', {
show: false,