jQuery Mobile w przykładach - <form><select> Przełącznik
<form><select data-role="flipswitch">
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed"><H1>Header</H1></div>
<div role="main" class="ui-content">
</select>
</form>
</div>
<div data-role="footer" data-position="fixed"><H1>Footer</H1></div>
</div>
</body>
</html>
Pobierz kod
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed"><H1>Header</H1></div>
<div role="main" class="ui-content">
<form>
<label for="flip-select">Flip toggle switch select:</label>
<select id="flip-select" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option>On</option>
</select>
<label for="flip-select-second">Flip toggle switch select:</label>
<select id="flip-select-second" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option selected="">On</option>
</select>
<label for="flip-3">Flip toggle switch:</label>
<select name="flip-3" id="flip-3" data-role="flipswitch" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
<label for="flip-8">Switch bez narożników</label>
<select name="flip-8" id="flip-8" data-role="flipswitch" data-corners="false">
<option value="off">Off</option>
<option value="on">On</option><label for="flip-select">Flip toggle switch select:</label>
<select id="flip-select" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option>On</option>
</select>
<label for="flip-select-second">Flip toggle switch select:</label>
<select id="flip-select-second" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option selected="">On</option>
</select>
<label for="flip-3">Flip toggle switch:</label>
<select name="flip-3" id="flip-3" data-role="flipswitch" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
<label for="flip-8">Switch bez narożników</label>
<select name="flip-8" id="flip-8" data-role="flipswitch" data-corners="false">
<option value="off">Off</option>
</select>
</form>
</div>
<div data-role="footer" data-position="fixed"><H1>Footer</H1></div>
</div>
</body>
</html>