Twitter bootstrap tooltip directions not working?

前端 未结 3 1782
借酒劲吻你
借酒劲吻你 2021-02-04 10:19

I noticed that my twitter bootstrap tooltips were not respecting data-position.

So, I headed over to the Twitter Bootstrap tooltips demo, specifically looki

3条回答
  •  终归单人心
    2021-02-04 10:25

    I think it's a bug. From http://twitter.github.com/bootstrap/assets/js/application.js you can see the demo is called with 'selector' option.

    $('.tooltip-demo').tooltip({
      selector: "a[data-toggle=tooltip]"
    });
    

    But the 'show' function in bootstrap-tooltip.js will not check for 'selector' option when handling 'placement'. Therefore bug occurred.

        placement = typeof this.options.placement == 'function' ?
          this.options.placement.call(this, $tip[0], this.$element[0]) :
          this.options.placement
    

    Demo for this bug: http://jsfiddle.net/indream/xFC7G/
    Related github issue: https://github.com/twitter/bootstrap/issues/6832

提交回复
热议问题