Fix the GoHighLevel form sometimes not appearing on /contact/
form_embed.js hides each embed off-screen until the iframe reports ready. With loading="lazy" the hidden iframe often never loaded, so it never reported ready and the form stayed invisible. Load the form eagerly, reserve its height, and reveal any embed still hidden after a few seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -143,5 +143,27 @@
|
||||
});
|
||||
}
|
||||
|
||||
// GoHighLevel's form_embed.js hides each embed until the iframe reports it is
|
||||
// ready. If that message never arrives, show the embed anyway so the form is
|
||||
// never left invisible.
|
||||
var reveal = function (f) {
|
||||
f.style.opacity = '1';
|
||||
f.style.visibility = 'visible';
|
||||
f.style.pointerEvents = 'auto';
|
||||
f.style.position = 'relative';
|
||||
if (f.style.left === '-9999px') f.style.left = '';
|
||||
};
|
||||
var ghl = document.querySelectorAll('.ghl-frame');
|
||||
if (ghl.length) {
|
||||
[2500, 6000].forEach(function (ms) {
|
||||
setTimeout(function () {
|
||||
ghl.forEach(function (f) {
|
||||
if (f.closest('[data-off]')) return;
|
||||
if (getComputedStyle(f).visibility === 'hidden') reveal(f);
|
||||
});
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
root.classList.add('ready');
|
||||
})();
|
||||
|
||||
@@ -1046,3 +1046,5 @@ h1, h2, h3, h4 { font-weight: 600; }
|
||||
@media (max-width: 760px) { .calls { grid-template-columns: 1fr; } .call { padding: 24px; } }
|
||||
#schedule .wrap { position: relative; }
|
||||
.cal-panel[data-off] { position: absolute; left: -10000px; top: 0; width: min(980px, 100%); visibility: hidden; pointer-events: none; }
|
||||
.ghl-wrap-form { min-height: 460px; }
|
||||
.ghl-wrap-cal { min-height: 720px; }
|
||||
|
||||
Reference in New Issue
Block a user