| | |
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
![]() |
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
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)
<html> <head> <style> .loading-indicator { font-size:8pt; background-image:url(../images/loading/loading.gif); background-repeat: no-repeat; background-position:top left; padding-left:20px; height:18px; text-align:left; } #loading{ position:absolute; left:45%; top:40%; border:3px solid #B2D0F7; background:white url(../images/loading/block-bg.gif) repeat-x; padding:10px; font:bold 14px verdana,tahoma,helvetica; color:#003366; width:180px; text-align:center; } </style> <script> function removeDivs() { document.getElementById('loading').style.display="none"; document.getElementById('MyIframe').style.display=""; } </script> </head> <body> <div id="loading"> <div class="loading-indicator"> Page Loading... <iframe id="MyIframe" src="flash.html" width="500" height="500" style="display:none"></iframe> </div> </div> </body> </html>
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
http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
(just google it there should be some tutorials about that.)
I hope that helps
![]() |
Similar Threads
- website loading or page loading screen. Help pls! (Graphics and Multimedia)
- Graphics (Graphics and Multimedia)
- How to fill the content with Ajax AFTER page fully loaded (JavaScript / DHTML / AJAX)
- standard io problem (C++)
- gif problem (Java)
- Chopped images (DaniWeb Community Feedback)
- php loading (PHP)
- Page Loading (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Smooth scrolling required
- Next Thread: How to remove underline and blue color from text in html?
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column cookies createrange() css cursor decimal dependent design disablefirebug dom download dropdown editor element engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword html htmlform ie8 iframe image() images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jump libcurl listbox math media microsoft mimic mp4 object onerror onmouseoutdivproblem onmouseover onreadystatechange parent pdf php player post problem progressbar regex runtime scroll search security select session shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n





