| | |
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?
Views: 2249 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxcode ajaxhelp animate array automatically autoplay beta boarder box bug button calendar captcha card cart codes column cookies createrange() css cursor date debugger decimal design developer dom download dropdown element enter error events firefox firehose flash focus form frameworks getselection google gwt html htmlform iframe image() images index java javascript javascripts jawascriptruntimeerror jquery jsp listbox maps marquee masterpage menu microsoft mimic mp3 mp4 offline onmouseover parameters php player post problem programming prototype rating redirect regex safari scale scriptlets search select size sources sql starrating text textarea toggle twitter validation variables w3c web website window windowofwords windowsxp xml xspf





