Jump to content

Loader gif


JonnoTheDev

Recommended Posts

Web project: hotel booking availability

On the above project I have a form that users select dates (arrival / departure) and enter a location to search. When complete the system will request available hotels from a remote server based on the user criteria. This is fine, however the remote server can take some time to return XML if there are a high number of hotels to return. What I implemented was a animated gif to be displayed while the data is being parsed. After the form is submitted and validated it simply displays the following:

// form validated
showLoader();

<div id="loading" style="display:none; position:absolute; width:100%; text-align:center; top:300px; z-index:300;"><img src="{$smarty.const.IMAGE_DIR}loader.gif" border="0"></div>
<script language="javascript">
var loader = document.getElementById("loading");
function showLoader() { 
loader.style.display = "block";
}
</script>

This displays fine on all browsers however on IE (v8 I am using) the gif does not animate. It sticks at the first frame until the results screen is displayed.

Am I missing something here?

Link to comment
https://forums.phpfreaks.com/topic/166179-loader-gif/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.