Search code examples
javascriptjqueryjquery-uibuttonjquery-ui-button

Jquery UI button issue


Please take a look at this

http://jsfiddle.net/WAre9/4/

The problem is, after changing the text of link, .button() doesn't work properly.

Here is scrshot before:

enter image description here

And after mouse click:

enter image description here

As you see all paddings, font styles have gone. Any suggestion? How to fix this problem?


Solution

  • This is from How do I replace jQueryUI button text?

    Maybe you could use the label option of the jQuery UI button now instead?

    $("#mybutton").button().toggle(function() {
      $(this).button('option', 'label', 'Stop');
    }, function() {
      $(this).button('option', 'label', 'Start');
    });
    

    jsbin preview here