Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save celticwebdesign/55fee63f910bd74e447ba3b29a4a32c9 to your computer and use it in GitHub Desktop.
Save celticwebdesign/55fee63f910bd74e447ba3b29a4a32c9 to your computer and use it in GitHub Desktop.
This code was used to test for a third-party booking system iframe, upon loading the availability, remove the loading animation and show iframe availability results.
HTML ----
<div class="container well checking" style="max-width:700px">
<h3>We are now searching for your desired availability</h3>
<img src='images/loading.svg' alt='Loading availability' width='120' height='120'>
// loading.svg made at: http://loading.io/
</div>
<div class="container well iframe" style="max-width:700px">
<?php
echo '<iframe id="booking-iframe" src="xxx" width="100%" scrolling="no" style="border:0;"></iframe>';
?>
</div>
css ----
body.book-now .container.well.iframe {display: none;}
body.book-now .container.well.checking {text-align: center;}
jQuery ----
$('iframe#booking-iframe').on('load', function() {
$('body.book-now .container.well.iframe').show();
$('body.book-now .container.well.checking').hide();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment