I am developing a webapp using phonegap for android .I m using jquery mobile tap event and for each tap event i want to show a loading div before displaying the content.I am seeing a delay between the tap event and display of loading div. Below is snippet of the code I have written
$('#events').bind('tap',function () {
document.getElementById("loadingDiv").style.display = "block";
});
and this my loadingDiv
<div id="loadingDiv"></div>
#loadingDiv {position: fixed; background:black url('images/ajax-loader.gif') no-repeat center 20%; height:100%; width:100%; z-index:100000;}
And also for speeding up the Jquery mobile I have turned off the transitions as well.
Please guide me on How to display the loadingDiv immediately for a nice user experience.