mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
86 lines
2.2 KiB
HTML
86 lines
2.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Input: Toggle</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link href="../vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
|
|
<link href="../dist/ionic.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
|
|
<section>
|
|
|
|
<header class="bar bar-header bar-dark">
|
|
<h1 class="title">Input: Toggle</h1>
|
|
</header>
|
|
|
|
<main class="content has-header">
|
|
|
|
<ul class="list">
|
|
<li class="list-item">
|
|
Airplane Mode
|
|
<label class="toggle">
|
|
<input type="checkbox" name="airplaneMode">
|
|
<div class="slide">
|
|
<div class="switch"></div>
|
|
</div>
|
|
</label>
|
|
</li>
|
|
<li class="list-item">
|
|
Do Not Disturb
|
|
<label class="toggle">
|
|
<input type="checkbox" name="doNotDisturb" checked="checked">
|
|
<div class="slide">
|
|
<div class="switch"></div>
|
|
</div>
|
|
</label>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="inset">
|
|
<p>
|
|
<button id="btnTest1">Toggle Airplane Mode</button>
|
|
</p>
|
|
|
|
<p>
|
|
<button id="btnTest2">Toggle Do Not Disturb</button>
|
|
</p>
|
|
|
|
<p><a class="button button-secondary" href="index.html">Homepage</a></p>
|
|
|
|
</div>
|
|
</main>
|
|
|
|
</section>
|
|
|
|
<!-- for testing only -->
|
|
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
|
|
<script>
|
|
|
|
$("#btnTest1").click(function(){
|
|
var toggle = $("[name='airplaneMode']")
|
|
if( toggle.prop("checked") ) {
|
|
toggle.prop("checked", false);
|
|
} else {
|
|
toggle.prop("checked", true);
|
|
}
|
|
return;
|
|
});
|
|
|
|
$("#btnTest2").click(function(){
|
|
var toggle = $("[name='doNotDisturb']")
|
|
if( toggle.prop("checked") ) {
|
|
toggle.prop("checked", false);
|
|
} else {
|
|
toggle.prop("checked", true);
|
|
}
|
|
return;
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|