Twitter bootstrap tooltip directions not working?

前端 未结 3 1772
借酒劲吻你
借酒劲吻你 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:47

    The easiest way I have found to initialize tooltips with Bootstrap is to match their code so any of your tooltips will work.

    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    });
    

    OR you can actually add this line to the very end of your bootstrap-tooltip.js file

    }(window.jQuery);  //<-- last line of bootstrap-tooltip.js
    
    $("[data-toggle='tooltip']").tooltip();
    

    I basically planned on if I am going to use the tooltip code, then I might as well have it enabled by default. So, I put this in my bootstrap-tooltip.js file.

提交回复
热议问题