本文介绍了jQuery UI的按钮不" unclicking"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


它们使用起来非常简单,但由于某些原因我的按钮不是unclicking。也就是说,我已经按下一个按钮后,它保持它的hover样式。如果我设置的onclick功能只是做一些简单的像警报的消息,我可以点击关闭按钮,它会恢复正常。这不是一个巨大的交易,即使它并不像演示正好工作。

http://jqueryui.com/demos/button/#defaultThey 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.

不过,如果我打开与的onClick功能的jQuery UI的对话框,悬停风格不会消失,即使是在关闭窗口,点击其他地方了。

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.

任何人都经历这些古灵精怪的小问题,并且知道解决办法?任何建议将不胜AP preciated。

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

推荐答案

更​​多的搜索后,这似乎是在jQuery UI的一个已知的bug。的

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

发布解决方法:

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

这篇关于jQuery UI的按钮不" unclicking"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:36