|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem while show hide div
Hi Friends,
I am writing one simple program where on button click I want to show loading gif. The code is as below: ============================================== [code] <html> <head> <script language="javascript"> function showHide() { document.getElementById("divImage").style.display="block" //document.getElementById("divImage").style.position = "absolute"; for (i=0;i<=5000;i++) { } document.getElementById("divImage").style.display="none"; } </script> </head> <body> <div id="divImage" style="display:none"><img id="img1" src="images/ajax-loader.gif" alt="" /></div> <input type="button" value="Refresh" ID="Button1" NAME="Button1" onClick="showHide()" /> </body> </html> [code/] ============================================== Problem: After clicking the Refresh button, I never see loading gif (even after increasing the "for loop" counter). but if I write alert function instead of for loop then it shows me loading gif. Please suggest me way to do it wihtout alert method. Thank You. Regards, Vikas |
|
#2
|
||||
|
||||
|
wouldn't it be better...
if you used setTimeout which calls a function to hide the gif after the specified time... ? edit ie you initially call a function which shows the div and then settimeout to call a function which hides the div ?
__________________
“Life may not be the party we hoped for, but while we are here we should sing, dance and be merry all the time....... "
|
|
#3
|
|||
|
|||
|
Hi aashishnakra,
Thanks for suggestion. Its solve my problem. Regards, Vikas |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Problem while show hide div |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|