SOURCE

console 命令行工具 X clear

                    
>
console
var $container = $("#pagination");
var $defaultExample = $("#defaultExample");
var $rangeExample=$("#rangeExample");
var $nodeExample=$("#nodeExample");

testDefault();
testRange();
testNode();

function testDefault() {
    $defaultExample.bhSlider({
        type: 'default', //default,range,node
        width: '100%',
        min: 0, //起始值
        max: 100, //结束值
        step: 1, //间隔
        value: 50, //当前取值
        disabled: false
    });
}

function testRange() {
   $rangeExample.bhSlider({
        type: 'range', //default,range,node
        width: '100%',
        min: 0, //起始值
        max: 100, //结束值
        step: 1, //间隔
        value: [10, 50], //当前取值
        disabled: false,
        nodeNum: 7
    });
}

function testNode() {
    
   $nodeExample.bhSlider({
        type: 'node', //default,range,node
        width: '100%',
        min: 0, //起始值
        max: 100, //结束值
        step: 1, //间隔
        value: 50, //当前取值
        disabled: false,
        nodeNum: 7
    });
}

$('div.bhSlder-button').on('click', 'button', function () {
    var action = $(this).attr('data-action');
    switch (action) {
        //打开预置弹框
        case "getDefaultValue":
            $defaultExample.bhSlider("getDotValue");
            break;
        //打开指定预置弹框
        case "getRangeValue":
            $rangeExample.bhSlider("getDotValue",0);
            break;
        //打开无页脚预置弹框
        case "getNodeValue":
           $nodeExample.bhSlider("getDotValue");
            break;
    }
});
<div class="bhSlder-button bh-mb-16">
    <button data-action="getDefaultValue">获取默认模式的值</button>
    <button data-action="getRangeValue">获取范围模式的值</button>
    <button data-action="getNodeValue">获取节点模式的值</button>
</div>
<div class="bh-mb-16">
    <div class="" id="defaultExample"></div>
</div>
<div class="bh-mb-16">
    <div class="" id="rangeExample"></div>
</div>
<div>
    <div class="" id="nodeExample"></div>
</div>
#wrap{
  margin: 16px;
}