开发者

jquery-ui button disable behavior is not right

开发者 https://www.devze.com 2023-01-09 18:09 出处:网络
I disable my jqueryui button in its click event like this $(\'#btn\').button().click(function(){ $(this).button(\'disable\');

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

精彩评论

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