Show GIF Loading BeforeUnload of the Page
I am working on an application that will work on both computer and Ipad, Iphone, Android tablets and phones. I have one requirement: to show loading ... gif when the user navigates from one page to another, because this will give the user information that the page is loading / unloading.
So I tried the below code /// below to display GIF when DOM is not ready.
$(document).ready(function(){
$("#loading").hide();});
// below is the code to display a GIF when the user clicks on some button to do some interaction with the server.
$(window).bind('beforeunload',function(){
$("#loading").show();});
where #load is the id of the div that contains my GIF code. This now works strongly on PC browsers, but not on Ipad, Iphone, and Android phones. I can't figure out why.
<div id="loading">
<img id="loading-image" src="/img/loading.gif" alt="Loading..." /></div>
This div is for loading GIFs.
+3
source to share