mirror of
https://gitee.com/layui/layui.git
synced 2025-10-26 10:49:18 +08:00
新增 slider 的 done 回调
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>滑块 - layui</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>滑块 - layui</title>
|
||||
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
|
||||
<style>
|
||||
body{padding:100px 0;}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
<style>
|
||||
body{padding:100px 0;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -31,14 +29,18 @@ layui.use('slider', function(){
|
||||
//,type: 'vertical'
|
||||
//,min: -20 //最小值
|
||||
//,max: 20 //最大值
|
||||
//,value: 10 //[40, 60] //初始值
|
||||
//,step: 10 //间隔值
|
||||
//,value: 11 //[40, 60] //初始值
|
||||
//,step: 1 //间隔值
|
||||
//,showstep: true //间隔点
|
||||
//,tips: false //关闭提示文本
|
||||
,input: true //输入框
|
||||
//,range: true //范围选择
|
||||
,change: function(value){ //回调实时显示当前值
|
||||
console.log(value)
|
||||
//,theme: '#FF5722'
|
||||
,change: function(value){ // 选中值发生改变的回调
|
||||
console.log('change', value)
|
||||
}
|
||||
,done: function(value){ // 值完成选中的回调 -- v2.8.0 新增
|
||||
console.log('done', value);
|
||||
}
|
||||
,setTips: function(value){ //自定义提示文本
|
||||
return value + '%';
|
||||
@@ -51,7 +53,7 @@ layui.use('slider', function(){
|
||||
//,theme: '#c00' //主题色
|
||||
});
|
||||
|
||||
sliderInst.setValue(30);
|
||||
//sliderInst.setValue(30);
|
||||
|
||||
|
||||
slider.render({
|
||||
|
||||
Reference in New Issue
Block a user