When a user schedules an appointment on our website, it triggers a change in the height of an iframe. I want to automatically hide the section above the iframe once the iframe's height has changed. Currently, I have implemented the following code which hides the section based on certain events such as page resize or scroll. However, I need it to dynamically hide the section instead of relying on these specific events.
$(window).on('load resize scroll', function() {
if ($(".remove-text").height() >= 582) {
$("#execphp-30, #execphp-47, #execphp-48").hide();
} else {
$("#execphp-30, #execphp-47, #execphp-48").show();
};
});
I am utilizing the iframeresizer js plugin to accurately update the height of the iframe dynamically.