-
Notifications
You must be signed in to change notification settings - Fork 3
/
segmentedcontrol.html
48 lines (36 loc) · 1.33 KB
/
segmentedcontrol.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="NKit.js"></script>
<script>
var navController = new NKNavigationController();
navController.setTitle("Segmented Control");
// Register the segmented control class
NKRegisterClass("segment");
</script>
</head>
<body style="margin-top:75px">
<script>
// Show the Segmented Control...
function showSegmentedControl()
{
CallNKitAction('showSegment?className=segment');
}
// aaand Remove it...
function removeSegmentedControl()
{
CallNKitAction('removeSegmentedControl?className=segment');
}
// Called when user changes the segmented control
function segmentUpdated(segSelected)
{
// DO SOMETHING HERE
NKAlert("via the mysterious magical witchcraft of NimbleKit's Objective-C/js mix, we can deduce that you pressed segment index...\n\n\n\n", segSelected);
}
</script>
<br><br><br><br><br><br><br> <!-- Bit chilly in here! -->
<div class="greybutton" onClick="showSegmentedControl()">Show Segmented Control</div>
<div class="greybutton"a onClick="removeSegmentedControl()">Remove Segmented Control</div>
</body>
</html>