所以就像我的标题所暗示的那样。我正在使用 switchy 在我的站点上创建开关。现在,一个工作完美。但是我需要 6 个,而且我一次不能让超过一个工作,即使使用不同的 ID/名称。
任何人都可以帮忙吗?
$('#switch-me').switchy();
<select id='switch-me'>
<option value='on'>on</option>
<option value='off'>off</option>
</select>
谢谢
--
<link href="CSS/switchy.css" rel="stylesheet" type="text/css" />
<link href="CSS/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="CSS/application.css" rel="stylesheet" type="text/css" />
<link href="CSS/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="js/jquery.animate-color.js"></script>
<script type="text/javascript" src="js/jquery.event.drag.js"></script>
<script type="text/javascript" src="js/switchy.js"></script>
<script type="text/javascript" src="js/application.js"></script>
<script>
$(function() {
$( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( "#to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
$(".switch").switchy();
</script>
<select class="switch">
<option value="female">female</option>
<option value="male">male</option>
</select>
<select class="switch">
<option value="yes">yes</option>
<option value="no">no</option>
</select>
<select class="switch">
<option value="false">false</option>
<option value="true">true</option>
</select>