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');
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user