Advertisement
hubert17

Display ajax loader During IFRAME Loading [jQuery]

Sep 29th, 2014
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.95 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>jQuery Demo - IFRAME Loader</title>
  6. <style>
  7. #frameWrap {position:relative;height: 360px;width: 640px;border: 1px solid #777777;background:#f0f0f0;box-shadow:0px 0px 10px #777777;}
  8. #iframe1 {height: 360px;width: 640px;margin:0;padding:0;border:0;}
  9. #loader1 {position:absolute;left:40%;top:35%;border-radius:20px;padding:25px;border:1px solid #777777;background:#ffffff;box-shadow:0px 0px 10px #777777;}
  10. </style>
  11. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  12. </head>
  13. <body>
  14.  
  15. <div id="frameWrap">
  16. <img id="loader1" src="/demo/images/loading.gif" width="36" height="36" alt="loading gif"/>
  17. <iframe id="iframe1" src="/demo/1508-iframe-loading-source.aspx" ></iframe>
  18. </div>
  19. <script>
  20.     $(document).ready(function () {
  21.         $('#iframe1').on('load', function () {
  22.             $('#loader1').hide();
  23.         });
  24.     });
  25. </script>
  26.  
  27. </body>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement