まだデータがありません。
select要素のプルダウン・メニューをスライダーに変更「Switchy」
当ページのリンクには広告が含まれています。
スポンサーリンク
select要素のプルダウン・メニューをスライダーに変更するプラグイン「Switchy」を紹介します。
jQueryプラグイン「Switchy」
このプラグインを使えば、select要素内のoption要素で作成するプルダウン・メニューをスライダーに変更することができます。
スライダーなので、プルダウン・メニューよりも選択が簡単ですね。
スポンサーリンク
それではデモページのスライダーをクリックしてみてください。
デモのソース(HTML + jQuery)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Switchy のデモでーす。">
<title>Switchy - jQueryプラグイン</title>
<link href="switchy.css" rel="stylesheet" />
</head>
<body>
<h1>Switchy のデモでーす。</h1>
<select id='switch-me'>
<option value='左'>左</option>
<option value='中' selected="selected">中</option>
<option value='右'>右</option>
</select>
<div id="console"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="switchy.js"></script>
<script>
$(function() {
$('#switch-me').switchy();
$('#switch-me').on('change', function(){
var log = $(this).val();
$('#console').html(log).hide().fadeIn();
});
});
</script>
</body>
</html>
スポンサーリンク