7

I'm using bootstrap 3 for my project layout. and also i need to jquery.ui javascript file for parts of my page. the problem is both bootstrap and jquery ui has the tooltip function and i want to use bootstrap tooltip, but jquery ui tooltip show up. is there any way to disable jquery ui tooltip without any effect on other jquery ui functions?

Siguza
  • 21,155
  • 6
  • 52
  • 89
hamed
  • 7,939
  • 15
  • 60
  • 114

4 Answers4

14

Solution is very very easy.

 <script src="/js/lib/jquery-ui.min.js"></script>
 <script src="/js/lib/bootstrap.min.js"></script>

Just load jQueryUI before loading boostrap and all will be ok! Worked for me.

Mario Villani
  • 533
  • 5
  • 16
  • 1
    One day you will be missing close-icon in dialogs by using such approach. https://stackoverflow.com/questions/17367736/jquery-ui-dialog-missing-close-icon – Oleksii Kyslytsyn Nov 21 '17 at 20:07
8

I was also facing the same issue and found a quick work around for this.

 <script src="/js/lib/bootstrap.min.js"></script>
 <script>var bootstrapTooltip = jQuery.fn.tooltip;</script>
 <script src="/js/lib/jquery-ui.min.js"></script>
 <script>jQuery.fn.tooltip = bootstrapTooltip;</script>

This will override jquery-ui's tooltip and use bootstrap's tooltip.

Bhagyesh Jain
  • 323
  • 2
  • 10
6

Just include what you need from jquery-ui! Go to http://jqueryui.com/download/ and only select the things you really use (without tooltip obviously).

Markus
  • 5,667
  • 4
  • 48
  • 64
1
 <script src="/js/lib/jquery-ui.min.js"></script>
 <script src="/js/lib/bootstrap.min.js"></script> 

is a fix which will not work for long run as UI btton or any plug in css might not work properly. Not solution.