components/bootstrap-switch

此包已被弃用且不再维护。未建议替代包。

将复选框和单选按钮转换为切换开关。

安装量: 4,099

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 965

语言:CSS

类型:组件

dev-master 2014-06-25 18:28 UTC

This package is not auto-updated.

Last update: 2016-02-14 09:29:48 UTC


README

Dependency Status devDependency Status NPM Version

将复选框和单选按钮转换为切换开关。

演示和文档

http://www.bootstrap-switch.org

使用方法

包含依赖项:jQuery、Bootstrap 和 Bootstrap Switch CSS + JavaScript

[...]
<link href="bootstrap.css" rel="stylesheet">
<link href="bootstrap-switch.css" rel="stylesheet">
<script src="jquery.js"></script>
<script src="bootstrap-switch.js"></script>
[...]

添加您的复选框

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

初始化 Bootstrap Switch

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

享受。

Less

如果您想使用您的 Bootstrap 变量,请将 bootstrap-switch.less 包含在您的编译堆栈中。您甚至可以选择与 Bootstrap 2.3.2 或 3.0 兼容的源。

AngularJs

提供两个自定义指令

KnockoutJs

这里有一个 Knockout 绑定处理程序 链接

NuGet

这里有一个 NuGet 包 链接

支持的浏览器

IE9+ 以及所有其他现代浏览器。

许可证

Apache 许可证,版本 2.0 链接