我已经阅读了api文档和论坛,并试图在初始设置后更改工具提示的内容,但是它不起作用。我究竟做错了什么?

HTML:

<p id="666">tooltip</p>


JQUERY

var qconfig = {
 show: 'mouseover',
 hide: { when: 'mouseout', fixed: true },
 position: { my: 'bottom center', at: 'top center', adjust: {y: 8} },
 style: { classes: 'qtip-light qtip-shadow' }
};

$("#666").qtip($.extend(true, qconfig, { content: { text: "before", title: "title is here" }}));
$("#666").qtip('option', 'content.text', 'after');
$("#666").qtip('api').set('content.text', 'another after');[/code]


我希望工具提示的内容是“之后”或“另一个之后”,但仍为“之前”。请帮助。

JSFiddle在这里:http://jsfiddle.net/Af64c/

最佳答案

您可以像这样更改内容

$('#666').data('qtip').options.content.text = 'after';


FIDDLE

09-25 17:53
查看更多