Reputation: 370
I have some difficulty to use the plugin BootStrap Switch http://www.bootstrap-switch.org/ I inserted both files css and js correctly into my project but it doesn't seem to work and I have no idea why. I'm using Bootstrap 3 and Bootstrap Switch 2.
Here my files loaded by BootStrapBundle which I retrieve at the top for the CSS and at the end of the page for the JS:
<link href="/Content/themes/base/jquery-ui.css" rel="stylesheet"/>
<link href="/Content/bootstrap.css" rel="stylesheet"/>
<link href="/Content/bootstrap-switch.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.0.3.js"></script>
<script src="/Scripts/jquery-ui-1.10.3.js"></script>
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive-custom-for-bootstrap.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/bootstrap-switch.js"></script>
I try several way to create it:
<div class="make-switch" >
<input type="checkbox" id="switchBox" />
</div>
<input type="checkbox" class="switch-default" />
Try it on IE10 and Chrome... I really don't know what I am doing wrong...
Here my jsfiddle http://jsfiddle.net/hGKNv/
Upvotes: 2
Views: 1584
Reputation: 370
I solved my prob! :D
<input type="checkbox" class="" id="switchBox" />
$("#switchBox").bootstrapSwitch();
It is not indicated that we have to set the function bootstrapSwitch function to the control... Hope this post will be helpful for those who forgot like me to indicate that into their JS. Anyway cheers for trying helping me!
Upvotes: 2