Search code examples
javascripttwitter-bootstraptooltippopover

Bootstrap tooltips and popovers: To Destroy, or NOT To Destroy?


if I create tooltips and popovers via BS' tooltip() and popover() methods, is there a need to do any explicit destroying of said creations if the DOM changes and the affected elements are no longer present? Am I creating JS dust bunnies by NOT explicitly destroying?


Solution

  • to put toolips on dynamic content you should use a delegate as such:$('body').toolip({selector: '.has-tooltip'}); and in this case, destroying is not needed.

    https://github.com/twbs/bootstrap/issues/4215

    http://jsbin.com/zopod/1/edit?html,css,js,output