<div id="eventbrite-widget-container"></div> <script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"></script>
(function() { let pendingEventId = null; let modalCreated = false; document.addEventListener('click', function(e) { const btn = e.target.closest('.event-ticket-btn'); if (btn) { let hiddenText = btn.parentElement.querySelector('.event-id-data'); if (!hiddenText) { hiddenText = btn.previousElementSibling?.classList.contains('event-id-data') ? btn.previousElementSibling : btn.nextElementSibling; } if (hiddenText && hiddenText.textContent) { pendingEventId = hiddenText.textContent.trim(); } } }); const checkPopup = setInterval(function() { const container = document.getElementById('eventbrite-widget-container'); if (container && container.offsetParent !== null && pendingEventId && !modalCreated && window.EBWidgets) { window.EBWidgets.createWidget({ widgetType: "checkout", eventId: pendingEventId, modal: true, // This makes it a modal modalTriggerElementId: "eventbrite-widget-container" }); modalCreated = true; // Auto-trigger the modal setTimeout(() => container.click(), 100); } }, 100); })();