Search code examples
jqueryjquery-uijquery-mobilejquery-slider

jQuery mobile slider disabled without being greyed out


I want to have a jQuery mobile slider which cannot be dragged but does not appear greyed out.

That is, I want the functionality of: <input type="range" value="86" min="0" max="100" disabled="true"/>

With the look of this: <input type="range" value="86" min="0" max="100"/>

http://jsfiddle.net/8cRFX/


Solution

  • I would really advise against displaying a disabled input with the same appearance of a normal input, I think it would prove negative in terms of UX.

    If you really have a good reason for it then you can use this code to remove the class that styles the input to be greyed out:

    $('input[disabled]').parent().find('.ui-disabled').removeClass('ui-disabled');