views:

20

answers:

1

http://jqueryui.com/demos/button/#default They are very simple to use, but for some reason my buttons are not "unclicking". That is, after I have clicked a button, it maintains it's hover style. If I set it's onClick function to just do something simple like alert a message, I can click off the button, and it will return to normal. This is not a huge deal even though it doesn't work exactly like the demo.

However, if I open a jQuery UI dialog with the onClick function, the hover style will not go away, even after closing the window and clicking elsewhere.

Has anyone else experienced these weird little issues, and know a solution? Any suggestions would be greatly appreciated.

A: 

After a bit more searching, this appears to be a known bug in jQuery UI. http://forum.jquery.com/topic/button-and-dialog-ui-state-focus-on-button-being-kept

Posted workaround:

button.click(function() {
    button.removeClass("ui-state-focus ui-state-hover");
    ...
Brett