jquery-uijqueryjquery-ui-button

Disable jQueryUI button and keep its original layout/style


If I disable jQueryUI button using "disabled" option, button goes dim. But I don't want it that way - I just want it unresponsive and styled in its original layout - no rollovers, no clicks - everything dead.

Unbinding button click from button doesn't help. Unbinding all events from button using unbind() just as well.

Any ideas?


Solution

  • In fact, you could just remove the "disabled" classes after disabling the button:

    $( "button" ).button();
    
    $( "button" ).button('disable');
    
    $( "button" ).removeClass('ui-button-disabled ui-state-disabled')
    

    Here is a fiddle : http://jsfiddle.net/9gq9n/