Page 1 of 1

Building a loading Screen

Posted: Thu Dec 11, 2003 5:38 am
by ihateevilbill
Hello again peeps,

What I wanna do is display a gif whilst curl is working, then hide it (using display:none or a php equivalent if possible) but I am having problems getting the bugger to hide again.

What I have so far is as follows (pseusocode):

Code: Select all

Show Header Images
If post > 0 (in other words there are post fields)
 show picture;
End if

Main html with form code etc

If post > 0 (see above)
 do curl statements;
 hide picture; - This is the line I cant work out
 display curl output;
end if
I can post the code if you think it would be easier to visualise what I am doing. Needless to say the image is showing after I click the submit button on my form, cURL is also sending the xml request, getting the XML response and then displaying it. Just cant work out how to hide the damned gif now :P

Thanks for all yer help,

Me

Posted: Thu Dec 11, 2003 3:38 pm
by volka
if you like it simple

Code: Select all

<html>
	<head>
		<title>lalala</title>
	</head>
	<body>
		<img src="imgs/green.png" id="processIndicator" style="visibility: visible;"/>
<?php
flush();
// something that takes quite a while
sleep(2);
?>
		<script type="text/javascript">
			var objImg = document.getElementById('processIndicator');
			if (objImg != null)
				objImg.style.visibility = "hidden";
		</script>
	</body>
</html>