Jquery UI按钮问题

时间:2012-07-22 11:05:21

标签: javascript jquery jquery-ui button jquery-ui-button

请看一下

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

问题是,在更改链接文本后,.button()无效。

以前是scrshot:

enter image description here

点击鼠标后:

enter image description here

当你看到所有填充时,字体样式已经消失了。有什么建议吗?如何解决这个问题?

3 个答案:

答案 0 :(得分:1)

这是How do I replace jQueryUI button text?

  

也许你现在可以使用jQuery UI按钮的label选项了吗?

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

jsbin preview here

答案 1 :(得分:1)

这是因为在设置span之后删除了element.text标记,请看这个小提琴:

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

或者您只需更改span元素的文本:

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

答案 2 :(得分:0)

http://jsfiddle.net/Bue3B/

使用儿童('span')。文字......

相关问题