Jquery easyui switchbutton简单使用 .
2016-08-19 17:15
387 查看
刚刚做完switchbutton这个的简单的功能,下面说说最使用的几点。html
<div class="state"><input class="easyui-switchbutton" onText="开" offText="关" name="unitState"></div>onText=“”和offText=“”就是设置里面的文字,为了下面js使用,起个name
.switchbutton-on { background: #EAF2FF; color: #000000; } /*开时的样式*/
.switchbutton-off { background: #E1E1E1; color: #000000; } /*关时的样式*/这个class类设置开关样式。注意引用css顺序,无论什么框架,先引用框架的css和js,再引用自己的css和js。这样自定义的css和js就能覆盖框架的,各位看官切记!说道这,有些框架的样式改不掉,js都不能覆盖,尝试在css样式后面添加!important试试。
.clear { clear: both !important; }像这样,只要我们的css在框架的css之后被加载,一般都会覆盖框架的css。
var thisSwitchbuttonObj = $(".state").find("[switchbuttonName='unitState']");//获取switchbutton对象var unitState = true;//是否选中的值
if(unitState){thisSwitchbuttonObj.switchbutton("check");}if(!unitState){thisSwitchbuttonObj.switchbutton("uncheck");}初始化按钮。
var thisValue = thisSwitchbuttonObj.switchbutton("options").checked;获取按钮的返回值,返回值类型:true或者false。
相关文章推荐
- Jquery easyui switchbutton简单使用
- Jquery easyui Tree的简单使用
- jquery-easyui简单使用
- JQuery使用Ajax的一个简单应用
- [原]ASP.NET中使用后端代码注册脚本 生成JQUERY-EASYUI 的界面错位
- jQuery-Selectors(选择器)的使用(三、简单篇)
- jQuery-Selectors(选择器)的使用(三、简单篇)
- jQuery 图像裁剪插件Jcrop的简单使用
- Jquery 高频使用方法 简单教程
- ASP.NET中使用后端代码注册脚本 生成JQUERY-EASYUI的界面错位的解决方法
- 时时刷新 jQuery Timers插件 提供定时执行的功能,使用非常简单
- ASP.NET中使用后端代码注册脚本 生成JQUERY-EASYUI的界面错位的解决方法
- 使用jquery-easyui写的CRUD插件(2)
- 使用jquery-easyui写的CRUD插件(3)
- 下面简单使用Jquery来操作iframe的一些记录,这个使用纯JS也可以实现。
- jquery 验证插件的简单入门使用
- jQuery的图像裁剪插件Jcrop的简单使用
- 使用jQuery.pager.js进行无刷新分页(当然想带刷新的话更简单)
- 处理Asp.net中使用 Jquery-easyui的 Confirm
- 使用jquery-easyui写的CRUD插件(1)