0

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?

2
  • There are no styles in fiddle. Commented Jul 22, 2012 at 11:08
  • @loler updated. sorry for old link Commented Jul 22, 2012 at 11:10

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

this worked for me, thx very much, but why 'option', 'label' not just 'label'??
if you go here: jqueryui.com/demos/button and look, it is because label is one of the 'options' of the button, you can look under methods too. hope this helps
One more thing, it's not related to this question but maybe you know. I'm using CSS reset technique, but jquery-ui widgets including button, are showing very huge, I mean font size. How can I scale size down?
1

It's because the span tag is removed after setting element.text see this fiddle:

http://jsfiddle.net/WAre9/8/

or you can just change text of span element:

http://jsfiddle.net/WAre9/10/

Comments

0

http://jsfiddle.net/Bue3B/

use children('span').text...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.