jquery which tell to users to wait
On my php webapp i have to generate some pdf files(between 5 and 20). A this moment I generate the files just before the pages loads, which is not a smart decision at all.
I wish to display the links to the pdf files, and a gif animation for each pdf link, which 'tells' to the user to wait, because that specific file is not available yet. I need to animaion to stop when the file is done.
Do开发者_C百科 you have any idea about how to implement this?
Do it as following.
- Generate your loading image
- Download your image
- Add following code anywhere you want to show it
<img id="loader" src="image-loader.gif" style="display:hidden" />
- Add following code before sending ajax request/doing another time-taking operation
<script>
$("#loader").show();
// do ajax
$("#loader").hide();
</script>
you're done
You can use the blockui plugin.
精彩评论