第3.1.7章 WEB系统最佳实践 js控件之bootstrap switch
2016-12-31 10:01
429 查看
bootstrap switch,效果如下:
虽然官网有很多例子,但是实际运用到项目中,就需要稍作处理。
js
虽然官网有很多例子,但是实际运用到项目中,就需要稍作处理。
<div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">迂回站/驱动站信息</h3> </div> <div class="panel-body"> <form role="form" id="updownForm" class="form-horizontal" action="${ctx}/ccsDataDictionary/edit"> <div class="form-group"> <label class="col-xs-3 text-right control-label">机房:</label> <div class="col-xs-9"> <input type="hidden" name="id" value="${updownData.id }"/> <input type="checkbox" class="form-control no-padding" id="isUp" name="valueField" checked="${updownData.valueField}" /> <span class="help-block">每个索道系统一个迂回房,一个驱动站</span> </div> </div> </form> </div> <div class="panel-footer text-right"> <div class="btn-group-sm"> <button class="btn btn-primary ladda-button" data-style="expand-left" data-size="1" type="button" id="btnSetUpDown" ><span class="ladda-label">设置</span></button> </div> </div> </div>
js
$('#isUp').bootstrapSwitch({size:'small',onText:'迂回站',offText:'驱动站',onColor:'success',offColor:'info'}); $('#isUp').bootstrapSwitch('state',$('#isUp').data('value'));
相关文章推荐
- 第3.1.3章 WEB系统最佳实践 js控件之bootstrap-datepicker的使用
- 第3.1.4章 WEB系统最佳实践 js控件之bootstrap-suggest-plugin
- 第3.1.5章 WEB系统最佳实践 js控件之Ladda
- 第3.1.2章 WEB系统最佳实践 js控件之requirejs的使用
- 第3.1.1章 WEB系统最佳实践 js控件之slimScroll的使用
- 第4.1.1章 WEB系统最佳实践页面实例-bootstrap登录页面
- 第2.1章 WEB系统最佳实践Spring文件配置
- 第2.1.3章 WEB系统最佳实践Spring文件配置之spring-dao.xml
- webpack-生产环境最佳实践(https://webpack.js.org/guides/production/)
- 第2.1.1章 WEB系统最佳实践Spring文件配置之spring-cache.xml
- 第2.1.9章 WEB系统最佳实践Spring文件配置之spring-dubbo.xml
- 第2.1.4章 WEB系统最佳实践Spring文件配置之spring-hessian-server.xml
- 第2.3.3章 WEB系统最佳实践属性配置之shiro.properties
- 第2.3章 WEB系统最佳实践属性配置
- 第4.1.2章 WEB系统最佳实践页面实例 角色管理
- 轻量级单点登录系统最佳实践(八)——5.3. 企业门户系统系统演示SSOLab.Portal.WebApp
- 第2.3.1章 WEB系统最佳实践属性配置之ehcache.xml
- 第2.1.8章 WEB系统最佳实践Spring文件配置之spring-email.xml
- 第2.3.2章 WEB系统最佳实践属性配置之jdbc.properties
- 第2.1.10章 WEB系统最佳实践Spring文件配置多数据源