Show loading Animation before iframe is fully loaded

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Dec 2008
Posts: 30
Reputation: Potato.Head is an unknown quantity at this point 
Solved Threads: 0
Potato.Head's Avatar
Potato.Head Potato.Head is offline Offline
Light Poster

Show loading Animation before iframe is fully loaded

 
0
  #1
Jun 23rd, 2009
Hi to all, I have the following situation:
I have an iframe and I want to display a loading animation to the user until the iframe is fully loaded, this is want I did:
1. I start the iframe with style:display:none
2. I have a div that wraps the iframe
3. When the iframe is fully loaded a method is called from the iframe 'removeDivs', I change the div to be invisble with style:display:none and I set the iframe to be visible with stle:display:""
4. The problem: Because the div wraps the iframe, after changing the style of the iframe its stay invisible, the property I set doesn't affect.
Thanks in advanced
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <style>
  4. .loading-indicator {
  5. font-size:8pt;
  6. background-image:url(../images/loading/loading.gif);
  7. background-repeat: no-repeat;
  8. background-position:top left;
  9. padding-left:20px;
  10. height:18px;
  11. text-align:left;
  12. }
  13. #loading{
  14. position:absolute;
  15. left:45%;
  16. top:40%;
  17. border:3px solid #B2D0F7;
  18. background:white url(../images/loading/block-bg.gif) repeat-x;
  19. padding:10px;
  20. font:bold 14px verdana,tahoma,helvetica;
  21. color:#003366;
  22. width:180px;
  23. text-align:center;
  24. }
  25. </style>
  26.  
  27. <script>
  28. function removeDivs()
  29. {
  30. document.getElementById('loading').style.display="none";
  31. document.getElementById('MyIframe').style.display="";
  32. }
  33. </script>
  34. </head>
  35. <body>
  36. <div id="loading">
  37. <div class="loading-indicator">
  38. Page Loading...
  39. <iframe id="MyIframe" src="flash.html" width="500" height="500" style="display:none"></iframe>
  40. </div>
  41. </div>
  42. </body>
  43. </html>
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 48
Reputation: yilmazhuseyin is an unknown quantity at this point 
Solved Threads: 5
yilmazhuseyin's Avatar
yilmazhuseyin yilmazhuseyin is offline Offline
Light Poster

Re: Show loading Animation before iframe is fully loaded

 
0
  #2
Jun 23rd, 2009
I am not really good with css but I think you should !important in your css. when you put !important tag in css that property does not overwriten by surrounding tags here is page
http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
(just google it there should be some tutorials about that.)
I hope that helps
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC