Turn the Tooltip Bootstrap functionality off

前端 未结 5 1758
不知归路
不知归路 2020-12-24 11:04

According the documentation is is possible to turn off the functionality just doing $(\'body\').off(\'.alert.data-api\').
In the case of tooltip I tried the

5条回答
  •  眼角桃花
    2020-12-24 11:39

    I struggled too with this, but I came up with a solution! In my case I use Jquery Sortable which is ofcourse annoying when you have tooltips flying around!

    So I made a variable

    var sort = '0`;
    

    And since almost every tooltip has an init() function, I created

    if(window.sort!='1') { // So I'm not sorting
      init.tooltip();
    }
    

    So, this can be the easiest enable/disable function!

提交回复
热议问题