JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script>
function doWork(){
//Append a lot of paragraphs
for (var i = 0; i < 10000; i++) {
$("div[data-role=content]").append("<p>This is some long string</p>");
}
$("div[data-role=content]").trigger("refresh");
$.mobile.loading('hide');
}
$(document).on("pageinit", "#page1", function(){
$("#btn1").click(function(){
$.mobile.loading('show', {theme:"e", text:"Please wait...", textonly:true, textVisible: true});
//Do something lengthy here
setTimeout(function(){
doWork();
}, 50);
});
});
</script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>Header</h1>
</div>
<div data-role="content">
<a id="btn1" href="#" data-role="button" data-transition="flip">Do work</a>
</div>
<div data-role="footer" data-position="fixed">
<h1>Footer</h1>
</div>
</div>
</body>
</html>