amazeui-switch

3.3.3 • Public • Published

Amaze UI Switch


checkboxradio 转换为按钮开关。

项目源自 Bootstrap Switch,只是将样式调整为 Amaze UI 风格,没有修改 JS 源码。

使用说明:

  1. 获取 Amaze UI Chosen:
  1. 在 Amaze UI 样式之后引入 Switch 样式:

Amaze UI Chosen 依赖 Amaze UI 样式。

<link rel="stylesheet" href="path/to/amazeui.min.css"/>
<link rel="stylesheet" href="path/to/amazeui.switch.css"/>
  1. 在 jQuery 之后引入 Switch 插件:
<script src="path/to/jquery.min.js"></script>
<script src="path/to/amazeui.switch.min.js"></script>
  1. 初始化 Switch:
$(function() {
  $('[name="my-checkbox"]').bootstrapSwitch();
});

可以监听到 jQuery Ready 事件的 DOM 也可以使用 data-am-switch 钩子自动初始化:

<input type="checkbox" data-am-switch />

Package Sidebar

Install

npm i amazeui-switch

Weekly Downloads

0

Version

3.3.3

License

MIT

Last publish

Collaborators

  • minwe