dojox
Version:
Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.
49 lines (44 loc) • 2.18 kB
HTML
<html style="overflow:hidden;">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Action Sheet Sample</title>
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="parseOnLoad: true, async:true"></script>
<script language="JavaScript" type="text/javascript">
require([
"dojo/_base/html", // dojo.byId
"dijit/_base/manager", // dijit.byId
"dojox/mobile", // This is a mobile app.
"dojox/mobile/compat", // This mobile app supports running on desktop browsers
"dojox/mobile/parser", // This mobile app uses declarative programming with fast mobile parser
"dojox/mobile/deviceTheme", // This mobile app automatically changes it's theme to match devices
"dojox/mobile/Button",
"dojox/mobile/Opener"
]);
function clicked(id){
dijit.byId("actionSheet").hide();
var span = dojo.byId("msgArea");
span.innerHTML += """ + dojo.byId(id).innerHTML + "" button was clicked.";
setTimeout(function(){
span.innerHTML = "";
}, 2000);
}
</script>
</head>
<body style="visibility:hidden;">
<center>
<button dojoType="dojox.mobile.Button" class="mblBlueButton" style="margin-top:20px;width:200px;"
onclick="dijit.byId('actionSheet').show(this.domNode, ['above-centered','below-centered','after','before'])">Open Action Sheet</button>
<div id="msgArea" style="margin-top:5px;"></div>
</center>
<!-- Action Sheet -->
<div id="actionSheet" data-dojo-type="dojox.mobile.Opener">
<button id="Bookmark" dojoType="dojox.mobile.Button" onclick="clicked(this.id)">Add Bookmark</button><br>
<button id="HomeScreen" dojoType="dojox.mobile.Button" onclick="clicked(this.id)">Add to Home Screen</button><br>
<button id="MailLink" dojoType="dojox.mobile.Button" onclick="clicked(this.id)">Mail Link to this Page</button><br>
<button id="cancel" dojoType="dojox.mobile.Button" onclick="clicked(this.id)">Cancel</button>
</div>
<!-- Action Sheet -->
</body>
</html>