Skip to content

Instantly share code, notes, and snippets.

@minhnc
Created March 7, 2012 09:12
Show Gist options
  • Save minhnc/1992098 to your computer and use it in GitHub Desktop.
Save minhnc/1992098 to your computer and use it in GitHub Desktop.
Custom Indicator
var win = Ti.UI.createWindow();
var overlay = Ti.UI.createWebView({
url: 'html/index.html',
opacity: 0.5,
backgroundColor: 'white',
zIndex: 1
});
var btn = Ti.UI.createButton({
title: 'Click me',
width: 100,
height: 40,
top: 10
});
win.add(btn);
win.add(overlay);
win.open();
btn.addEventListener('click', function(e){
alert('Click');
});
<html>
<head>
<style>
#ajaxloader-wrapper {
width: 50px; // image width
height: 50px; // image height
position: absolute;
left: 50%;
top: 50%;
margin: -25px 0 0 -25px; // -1/2 * image width/height
}
</style>
</head>
<body style="background-color: white">
<div id="ajaxloader-wrapper">
<!--TODO: Should store this image to local resource for better performance -->
<img src="http://deltacouncil.ca.gov/sites/all/themes/delta/images/ajax-loader-round.gif">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment