bootstrapSwitch无法正常显示

时间:2016-04-13 19:22:45

标签: javascript jquery twitter-bootstrap switch-statement

我使用的是bootstrapSwitch,但它没有正确显示。 它看起来像这样,它的状态无法改变。我尝试使用以下代码:



<input type="checkbox" name="my-checkbox" checked>
&#13;
&#13;
&#13;

&#13;
&#13;
$("[name='my-checkbox']").bootstrapSwitch();
&#13;
&#13;
&#13;

switch

我哪里错了?谢谢!

1 个答案:

答案 0 :(得分:1)

在此cdn中包含bootstrap-switch.min.css和bootstrap-switch.min.js:https://cdnjs.com/libraries/bootstrap-switch

还包括bootstrap.min.css,它运行得非常好。

<input type="checkbox" name="my-checkbox" checked>

$("[name='my-checkbox']").bootstrapSwitch();

请参阅此jsfiddle:https://jsfiddle.net/mayank_shubham/deg4ztf4/

相关问题