Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
One Response
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.
Vi sender dig en mail, når den er klar — og spørger blidt om din mening undervejs.
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('[data-popup-id]').forEach(function (btn) {
btn.addEventListener('click', function (e) {
e.preventDefault();
var popupId = btn.getAttribute('data-popup-id') || '';
var theme = btn.getAttribute('data-theme') || '';
var imageUrl = btn.getAttribute('data-image') || '';
var age = btn.getAttribute('data-age') || '';
var desc = btn.getAttribute('data-desc') || '';
// Open Elementor popup
if (window.elementorProFrontend) {
elementorProFrontend.modules.popup.showPopup({ id: popupId });
}
setTimeout(function () {
// Swap image
var art = document.querySelector('.lumio-popup-art img');
if (art && imageUrl) {
art.src = imageUrl;
art.alt = theme;
}
// Fill book title
var titleEl = document.getElementById('lumio-popup-book-title');
if (titleEl) titleEl.textContent = theme;
// Fill description
var descEl = document.getElementById('lumio-popup-book-desc');
if (descEl) descEl.textContent = desc;
// Hidden CF7 field — theme name
var themeField = document.getElementById('hidden-theme');
if (themeField) themeField.value = theme;
// Pre-select age dropdown
var ageField = document.querySelector('.wpcf7-form select[name="child-age"]');
if (ageField && age) {
for (var i = 0; i < ageField.options.length; i++) {
if (ageField.options[i].text.indexOf(
age.replace(' år','').trim()) !== -1) {
ageField.selectedIndex = i;
break;
}
}
}
}, 400);
});
});
// Pass selected price to hidden field
document.addEventListener('change', function (e) {
if (e.target && e.target.name === 'price-point') {
var priceField = document.getElementById('hidden-price');
if (priceField) priceField.value = e.target.value;
}
});
});
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.