English 中文(简体)
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/





相关问题
Jquery UI button on items added after page load

i have the jquery ui button widget working w/ the following code. $(.remove_img).button({ icons: { primary: ui-icon-cancel } }); but if there isn t an image in place, on upload, i am ...

How to show disabled state for a jqueryui button?

I am using Jquery UI buttons (http://jqueryui.com/demos/button/). I would like to know how I can show a disabled state. Show the button as greyed out or something, you know how when you post a form on ...

Changing jQuery UI Button size?

I ve been using the jQuery UI button all over my page, however I haven t found a way around what seems to be a simple problem. I want some of my buttons to be smaller than the other, this should be as ...

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 ...

Can I set a Custom Icon for a jQueryUI Button

Is it possible to create a jQueryUI Button with a custom icon, ie: an icon that is not part of the sprite icons that are provided with jQueryUI??? I am using the ButtonSet functionality for a group ...

Jquery UI button gets disabled on refresh

I asked about this on the jquery forum a few weeks ago without luck, so I will try again here :) I ve made a simple widget for a project I m working on, but I have encountered an odd problem. It is ...

热门标签