开发者

jquery-ui button disable behavior is not right

I disable my jqueryui button in its click event like this

$('#btn').button().click(function(){
    $(this).button('disable');
});
开发者_开发百科

and it seems that the button always stays in hover state when I enable it in another place later. I have tried to add $('#btn').button('refresh'), but it's not work. How can I restore its state to default when it's been enabled?


You can use .trigger('mouseout').

Demo here


When you use the jQuery UI, usually you also use the embedded CSS. When you disable an element the library add the relative class. Maybe you can disable this behaviour when you declare the button.

Try http://jqueryui.com/demos/button/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜