実行結果
設置サンプルのソース
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Introducing iPhone-style Checkboxes | 設置サンプル</title>
<link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
<!-- JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/content/lib/jquery/iphone_style_checkboxes/iphone-style-checkboxes.js"></script>
<script type="text/javascript">
$(function(){
$(':checkbox').iphoneStyle();
});
</script>
<!-- CSS -->
<style type="text/css">
.container {
position:relative;
width:85px; height:27px;
cursor:pointer;
overflow:hidden;
}
.container input {
position:absolute;
top:5px; left:30px;
}
.handle {
display:block;
width:39px; height:27px;
cursor:pointer;
position:absolute;
top:0; left:0;
}
.handle .bg {
position:absolute;
width:5px; height:100%;
top:0; left:0;
z-index:1;
}
.handle .slider {
position:absolute;
top:0; left:0;
width:39px; height:27px;
background:url("/content/lib/jquery/iphone_style_checkboxes/slider.png") no-repeat;
z-index:2;
}
label.on, label.off {
font-size:17px;
line-height:17px;
font-weight:bold;
font-family:Helvetica Neue, Arial, Helvetica, sans-serif;
text-transform:uppercase;
cursor:pointer;
display:block;
width:52px; height:22px;
position:absolute;
top:0;
}
label.on {
color:#fff;
background:url("/content/lib/jquery/iphone_style_checkboxes/on.png") no-repeat;
text-shadow:0px 0px 2px rgba(0, 0, 0, 0.6);
left:0;
padding:5px 0 0 8px;
}
label.off {
color:#8B8B8B;
background:url("/content/lib/jquery/iphone_style_checkboxes/off.png") no-repeat right 0;
text-shadow:0px 0px 2px rgba(255, 255, 255, 0.6);
text-align:right;
right:0;
padding:5px 8px 0 0;
}
</style>
<link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
<body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<div id="wrap">
<h1><a href='http://awardwinningfjords.com/'>Introducing iPhone-style Checkboxes</a> | 設置サンプル</h1>
<!-- CODE -->
<h2>デフォルトでOFF</h2>
<input type="checkbox" />
<h2>デフォルトでON(checked="checked")</h2>
<input type="checkbox" checked="checked" />
<!-- / CODE -->
</div>
</body>
</html>