diff --git a/index.html b/index.html
index b1891c8e..3163f0c2 100644
--- a/index.html
+++ b/index.html
@@ -206,6 +206,9 @@
Highlight Feature
Custom Classes
Popover Hook
Padding Change
+ Content (String)
+ Content (Element)
+ Content (Interactive)
Tour Feature
@@ -918,7 +921,8 @@ Usage and Demo
element: ".page-header h1 sup",
popover: {
title: "Buggy Highlight",
- description: "Unlike the older version, new version doesn't work with z-indexes so no more positional issues.",
+ description:
+ "Unlike the older version, new version doesn't work with z-indexes so no more positional issues.",
side: "bottom",
align: "start",
},
@@ -930,7 +934,8 @@ Usage and Demo
element: ".container",
popover: {
title: "Buggy Highlight",
- description: "Unlike the older version, new version doesn't work with z-indexes so no more positional issues.",
+ description:
+ "Unlike the older version, new version doesn't work with z-indexes so no more positional issues.",
side: "bottom",
align: "start",
},
@@ -1160,6 +1165,73 @@ Usage and Demo
document.getElementById("destroy-btn").addEventListener("click", () => {
driver().destroy();
});
+
+ document.getElementById("test-content-string").addEventListener("click", () => {
+ const driverObj = driver();
+ driverObj.highlight({
+ element: "#test-content-string",
+ popover: {
+ title: "Content with HTML String",
+ description: "This is the regular description.",
+ content:
+ 'Custom Content This content is inserted via an HTML string.
',
+ },
+ });
+ });
+
+ document.getElementById("test-content-element").addEventListener("click", () => {
+ const driverObj = driver();
+
+ // Create a custom element
+ const contentDiv = document.createElement("div");
+ contentDiv.style.cssText = "padding: 10px; background: #f0f0f0; border-radius: 5px; margin-top: 5px;";
+
+ const title = document.createElement("strong");
+ title.textContent = "Dynamically Created DOM Element";
+
+ const list = document.createElement("ul");
+ list.style.cssText = "margin: 10px 0 0 0; padding-left: 20px;";
+ ["Item 1", "Item 2", "Item 3"].forEach(text => {
+ const li = document.createElement("li");
+ li.textContent = text;
+ list.appendChild(li);
+ });
+
+ contentDiv.appendChild(title);
+ contentDiv.appendChild(list);
+
+ driverObj.highlight({
+ element: "#test-content-element",
+ popover: {
+ title: "Content with DOM Element",
+ description: "The description is displayed first.",
+ content: contentDiv,
+ },
+ });
+ });
+
+ document.getElementById("test-content-interactive").addEventListener("click", () => {
+ const driverObj = driver();
+
+ const contentDiv = document.createElement("div");
+ contentDiv.style.cssText = " margin-top: 5px; text-align: center;";
+
+ const img = document.createElement("img");
+ img.src = "https://i.imgur.com/EAQhHu5.gif";
+ img.alt = "Demo animation";
+ img.style.cssText = "max-width: 100%; height: auto;";
+
+ contentDiv.appendChild(img);
+
+ driverObj.highlight({
+ element: "#test-content-interactive",
+ popover: {
+ title: "Interactive Content",
+ description: "This popover contains an image!",
+ content: contentDiv,
+ },
+ });
+ });