IOS 7 Switch

Developer
Size
2,235 Kb
Views
26,312

How do I make an ios 7 switch?

Example of ChocolateChip-UI switch control. This expects Safari or iOS device running iOS 6 or 7.. What is a ios 7 switch? How do you make a ios 7 switch? This script and codes were developed by Robert Biggs on 24 August 2022, Wednesday.

IOS 7 Switch Previews

IOS 7 Switch - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>iOS 7 Switch</title> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-tap-highlight" content="no"> <link rel='stylesheet prefetch' href='https://s3-us-west-2.amazonaws.com/s.cdpn.io/77047/chui.ios-3.0.4.min.css'>
</head>
<body> <nav class='current'>	<h1>iOS 7 Switch</h1>
</nav>
<article id="main" class="current">	<section>	<ul class='list'>	<li class='comp'>	<div>	<h3>Sleep</h3>	</div>	<aside>	</aside>	</li>	</ul>	<ul class='list'>	<li class='comp'>	<div>	<h3>Vacation</h3>	</div>	<aside>	</aside>	</li>	</ul>	<ul class='list'>	<li class='comp'>	<div>	<h3>Breakfast</h3>	</div>	<aside>	</aside>	</li>	</ul>	<p><span><strong>Response: </strong></span><span id="response"></span></p>	</section>
</article> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/77047/chui-3.0.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

IOS 7 Switch - Script Codes JS Codes

$(function() {	var sleepSwitch = {	id : "sleepSwitch",	state : "on",	name : "activity.choice",	value: "sleep"	};	var vacationSwitch = {	id : "vacationSwitch",	state : "off",	name : "activity.choice",	value : "vacation"	};	var breakfastSwitch = {	id : "breakfastSwitch",	state : "off",	name : "activity.choice",	value : "breakfast"	};	$('aside').each(function(ctx, idx) {	if (window && window.jQuery) {	temp = ctx;	ctx = idx;	idx = temp;	}	switch (idx){	case 0:	$(ctx).prepend($.UICreateSwitch(sleepSwitch));	break;	case 1:	$(ctx).prepend($.UICreateSwitch(vacationSwitch));	break;	case 2:	$(ctx).prepend($.UICreateSwitch(breakfastSwitch));	break;	}	})	$('.switch').UISwitch();	// Set response to last checked switch:	$('.switch').each(function(ctx, idx) {	var temp; if (window && window.jQuery) { temp = ctx; ctx = idx; idx = temp; }	if (ctx.classList.contains('on')) {	$('#response').html($(ctx).find('input').val());	}	});	var handleSwitch = function(_switch) {	var value = '';	if (_switch.classList.contains('on')) {	value = $(_switch).find('input').val();	$('#response').html(value);	} else {	$('#response').empty();	}	};	$.body.on('singletap', '.switch', function() {	handleSwitch(this);	});
});
IOS 7 Switch - Script Codes
IOS 7 Switch - Script Codes
Home Page Home
Developer Robert Biggs
Username rbiggs
Uploaded August 24, 2022
Rating 3
Size 2,235 Kb
Views 26,312
Do you need developer help for IOS 7 Switch?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Robert Biggs (rbiggs) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!