jQuery UI滑块禁用部分 [英] Jquery UI slider disable part

查看:94
本文介绍了jQuery UI滑块禁用部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个Jquery UI滑块,其范围从0到100,并且手柄最大为75.因此在滑块中可见75到100的部分,但是手柄最大为75.

I need an Jquery UI slider that has an range from 0 till 100 and where the handle is max 75. So the part 75 till 100 is visible in the slider but the handle goes max to 75.

使用Jquery Ui滑块可以吗?

is that possible with Jquery Ui slider?

 $( "#slider-vertical" ).slider({
    orientation: "vertical",
    range: true,
    values: [ 1, 75 ],
    range: "max",
    min: 1,
    max: 100        
});

推荐答案

尝试一下

$('#slider-vertical').slider({
    values: [1, 100],
    range: true,
    slide: function(event, ui) {
        if(ui.value > 75 && ui.value <= 100){
            return false;
        }
    }
});

这篇关于jQuery UI滑块禁用部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆