material-design-lite icon indicating copy to clipboard operation
material-design-lite copied to clipboard

Disabled a part of the slider

Open vipera7 opened this issue 7 years ago • 6 comments

I would like to ask if it's possible to make a part of the slider disable ? Which will look like :

enter image description here

https://jsfiddle.net/2b6zoprf/

In this exemple, the slider will start at 0 but in the range of 0 to 172 we can't access it, so the new minimum is 172. Maybe I need to use a second slider ?

vipera7 avatar Nov 20 '18 13:11 vipera7

I don't know any build in option to do this.

And yes, i think the best way is to prepend a disabled slider with calculated width.

If you need any help, let me know, maybe i can support you.

aburai avatar Nov 20 '18 13:11 aburai

I think I'm going to use jquery ui http://jsfiddle.net/myLpqrxw/11/

vipera7 avatar Nov 20 '18 13:11 vipera7

You'd need to update the slider's min/max values dynamically. What impact that would have on MDL I don't know for sure. This kind of functionality isn't even available in the native slider for the web.

Garbee avatar Nov 20 '18 14:11 Garbee

@Garbee But with jQuery UI it's possible. Even if I change the min and max value it would'nt work as expected.

vipera7 avatar Nov 20 '18 14:11 vipera7

I made no comment on jQuery UI. What it has isn't of any real relevance to Material Design. I'm just explaining why this is the way it is in MDL and how you'd achieve the effect desired in some form.

If another tool fits your needs better, then by all means use it.

Garbee avatar Nov 20 '18 19:11 Garbee

I thought you mean it's impossible to do a such thing. Just wanted to know if this feature will be in the futur of MDL.

vipera7 avatar Nov 21 '18 09:11 vipera7