Question

I've read the api docs and forums and am trying to change the content of a tooltip after it's been set initially, however it is not working. What am I doing wrong?

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]

I would expect the content of the tooltip to be "after" or "another after" but it remains "before". Help please.

JSFiddle is here: http://jsfiddle.net/Af64c/

Était-ce utile?

La solution

You can change the content like this

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

FIDDLE

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top