Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using bootstrap-popover to show a message beside an element.

If I want to show different text in the popover after the first time, the text does not change. Re instantiating the popover with new text does not overwrite.

See this js fiddle for a live example:

http://jsfiddle.net/RFzvp/1/

(The message in the alert and the message in the dom is inconsistent after the first click) The documentation is a bit light on how to unbind: http://twitter.github.com/bootstrap/javascript.html#popovers

Am I using this wrong? The Any suggestions on how to work around?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
248 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can access the options directly using the jquery data closure dictionary like this:

$('a#test').data('bs.popover').options.content = 'new content';

This code should work fine even after first initializing the popover.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...