第二百二十节,jQuery EasyUI,Slider(滑动条)组件
jQuery EasyUI,Slider(滑动条)组件

学习要点:
1.加载方式
2.属性列表
3.事件列表
4.方法列表
本节课重点了解 EasyUI 中 Slider(滑动条)组件的使用方法,这个组件依赖于 Draggable(拖动)组件。
一.加载方式
class 加载方式
<input class="easyui-slider" value="12" style="width:300px" data-options="showTip:true,rule:[0,'|',25,'|',50,'|',75,'|',100]" />
slider()将一个输入框执行滑动条方法
JS 加载调用
$(function () {
$('#box').slider({
width: 300,
value: 12,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
});
});
二.属性列表


width number 滑动条宽度。默认值 auto。
$(function () {
$('#box').slider({
width: 300,
height: 50,
mode:'v'
});
});
height number 滑动条高度。默认值 auto。
$(function () {
$('#box').slider({
width: 300,
height: 50,
mode:'v'
});
});
mode string 声明滚动条类型。可用值有:'h'(水平)、'v'(垂直)。默认值'h'。
$(function () {
$('#box').slider({
width: 300,
height: 50,
mode:'v'
});
});
reversed boolean 设置为 true 时,最小值和最大值将对调他们的位置。默认值 false。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
reversed:true
});
});
showTip boolean 定义是否显示值信息提示。默认值 false。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true
});
});
disabled boolean 定义是否禁用滑动条。默认值 false。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
disabled:true
});
});
value number 默认值。默认值0。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
value:
});
});
min number 允许的最小值。默认值0。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
min:10, //允许的最小值
max:90, //允许的最大值
});
});
max number 允许的最大值。默认值100。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
min:10, //允许的最小值
max:90, //允许的最大值
});
});
step number 增加或减少值。默认值1。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
step:10, //增加或减少值。默认值1。
});
});
rule array显示标签旁边的滑块,'|' — 只显示一行。默认值[]。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
});
tipFormatter function 该函数用于格式化滑动条。返回的字符串值将显示提示。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
tipFormatter:function (value) {
return value + '%';
}
});
});
三.事件列表

onChange newValue, oldValue 在字段值更改的时候触发。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
onChange:function (newValue, oldValue) {
alert('接收更改后的值'+newValue);
alert('接收更改前的值'+oldValue);
}
});
});
onSlideStart value 在开始拖拽滑动条的时候触发。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
onSlideStart:function (value) {
alert(value);
}
});
});
onSlideEnd value 在结束拖拽滑动条的时候触发。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
onSlideEnd:function (value) {
alert(value);
}
});
});
四.方法列表

options none 返回滑动条属性。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
alert($('#box').slider('options'));
});
destroy none 销毁滑动条对象。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('destroy');
});
resize param设置滑动条大小。'param'参数包含一下属性:width:新滑动条宽度。height:新滑动条高度。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('resize',{
width:500,
height:20
});
});
getValue none 获取滑动条的值。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
alert($('#box').slider('getValue'));
});
setValue value 设置滑动条的值。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('setValue',90);
});
clear none 清除滑动条的值。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('clear');
});
reset none 重置滑动条的值。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('reset');
});
enable none 启用滑动条控件。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('enable');
});
disable none 禁用滑动条控件。
$(function () {
$('#box').slider({
width: 300,
rule: [0, '|', 25, '|', 50, '|', 75, '|', 100],
showTip:true,
});
$('#box').slider('disable');
});
使用$.fn.slider.defaults 重写默认值对象。
第二百二十节,jQuery EasyUI,Slider(滑动条)组件的更多相关文章
- 第二百零三节,jQuery EasyUI,Window(窗口)组件
jQuery EasyUI,Window(窗口)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 Window(窗口)组件的使用方法,这个组件 ...
- 第二百二十二节,jQuery EasyUI,DataGrid(数据表格)组件
jQuery EasyUI,DataGrid(数据表格)组件 学习要点: 1.加载方式 2.分页功能 本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于 Pa ...
- 第三百二十节,Django框架,生成二维码
第三百二十节,Django框架,生成二维码 用Python来生成二维码,需要qrcode模块,qrcode模块依赖Image 模块,所以首先安装这两个模块 生成二维码保存图片在本地 import qr ...
- Slider( 滑动条) 组件
本节课重点了解 EasyUI 中 Slider(滑动条)组件的使用方法,这个组件依赖于Draggable(拖动)组件. 一. 加载方式//class 加载方式<input class=" ...
- 第二百二十六节,jQuery EasyUI,Tree(树)组件
jQuery EasyUI,Tree(树)组件 本节课重点了解 EasyUI 中 Tree(树)组件的使用方法,这个组件依赖于 Draggable(拖 动)和 Droppable(放置)组件. 一.加 ...
- 第二百二十三节,jQuery EasyUI,ComboBox(下拉列表框)组件
jQuery EasyUI,ComboBox(下拉列表框)组件,可以远程加载数据的下拉列表组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 C ...
- 第二百二十五节,jQuery EasyUI,PropertyGird(属性表格)组件
jQuery EasyUI,PropertyGird(属性表格)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解 EasyUI 中 PropertyGird(属性表格)组件的 ...
- 第二百二十四节,jQuery EasyUI,ComboGrid(数据表格下拉框)组件
jQuery EasyUI,ComboGrid(数据表格下拉框)组件 学习要点: 1.加载方式 2.属性列表 3.方法列表 本节课重点了解 EasyUI 中 ComboGrid(数据表格下拉框)组件的 ...
- 第二百二十九节,jQuery EasyUI,后台管理界面---后台登录
jQuery EasyUI,后台管理界面---后台登录 登录原理图 一,login.php,登录界面 <!DOCTYPE html> <html> <head> & ...
随机推荐
- Fireworks层与蒙版的概念和用法
添加热点也是可以嵌套的 切片工具将自动保存在网页图层,并且可以导出为图像 组合为蒙版就是让一部分图形显示的填充为一幅图片的东西,删除蒙版即可将其转换为一个普通的图层,否则还可以移动位置
- onethink 密码加密方式详解
/** * 系统非常规MD5加密方法 * @param string $str 要加密的字符串 * @return string */ function think_ucenter_md5($str, ...
- Building Vim from source(转)
Compiling Vim from source is actually not that difficult. Here's what you should do: First, install ...
- Executor / Executors / ExecutorService /
Java SE5的java.util.concurrent包中的执行器(Executor)将为你管理Thread对象,从而简化了并发编程.Executor在客户端和执行任务之间提供了一个间接层,Exe ...
- 07-hibernate注解-一对多(多对一)双向外键关联
一对多(多对一)双向外键 多方:多方持有一方的引用. @ManyToOne(cascade={CasCadeType.ALL},fetch=FetchType.EAGER) @JoinColumn(n ...
- poj3177 Redundant Paths 边双连通分量
给一个无向图,问至少加入多少条边能够使图变成双连通图(随意两点之间至少有两条不同的路(边不同)). 图中的双连通分量不用管,所以缩点之后建新的无向无环图. 这样,题目问题等效于,把新图中度数为1的点相 ...
- 【Shiro】Apache Shiro架构之集成web
Shiro系列文章: [Shiro]Apache Shiro架构之身份认证(Authentication) [Shiro]Apache Shiro架构之权限认证(Authorization) [Shi ...
- spring中添加redis缓存
1.单机版的添加 spring里面配置 <bean id="redisClient" class="redis.clients.jedis.JedisPool&qu ...
- 动态规划初级 入门理解 C#代码
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Micros ...
- host文件配置 了解
https://blog.csdn.net/CJF_iceKing/article/details/7702694 hosts文件位于" C:\Windows\System32\driver ...