Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How can I show loading on the InAppBrowser

$
0
0

@rknbrk wrote:

<img id="loading" name="loading" src="img/loading.GIF" style="position: absolute;top: 50%;left: 50%;margin-left:-32px;margin-top:-32px;">
<script>
    	$('#loading').hide();
    	document.addEventListener("deviceready", onDeviceReady, false);
        function onDeviceReady() 
    	{
    		 ref = window.open('http://mywebsite.com', '_self', 'location=no,zoom=no,hardwareback=yes,hidden=yes');
    		ref.addEventListener('loadstart', function(event) { $('#loading').show(); });
    		ref.addEventListener('loadstop', function(event) { $('#loading').hide(); ref.show(); });
    		ref.addEventListener('loaderror', function(event) { ref.close(); alert("Connection Error!"); ionic.Platform.exitApp();});
    		ref.addEventListener('exit', function(event) {ionic.Platform.exitApp();});
    						 
    	}
</script>

In here I want to show loading.gif on the screen when inappbrowser load any page. But after first load, it doesn't work anymore. Because loading.gif stays back of inappbrowser. How can I show this gif on the screen with every page load?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>