Bootstrap tooltip not working in chrome
Asked Answered
C

2

1

Bootstrap Tooltip not working in chrome, but working fine in firefox.

<script type='text/javascript'>
 jQuery(document).ready(function () {
 if ($("[rel=tooltip]").length) {
 jQuery("[rel=tooltip]").tooltip({
placement: 'right',
trigger: "hover"
});
 }
});
</script>

And also the placement is not working correctly in firefox, even after defining as right, its showing only on top.

Contra answered 22/8, 2013 at 5:52 Comment(4)
looks fine jsfiddle.net/arunpjohny/4HptX/2Brutify
can you update the jsfiddle to recreate the case... also the versions of jQuery and bootstrap usedBrutify
Bootstrap version - v2.2.1, jQuery - v1.6.3Contra
Is it something with versions? Not working correctly in chrome? However i loaded it with new version of Bootstrap 3.0 and Jquery 2.0 using CDN, but also not working in chrome.Contra
B
1

You need to update your jQuery to at least 1.7 because it looks like bootstrap 2.2.1 is using .on().

Look at your browser console, it is throwing an error

Uncaught TypeError: Object [object Object] has no method 'on'

Brutify answered 22/8, 2013 at 6:10 Comment(10)
Is showing error as 'Uncaught TypeError: Object [object Object] has no method 'styleSwitcher''Contra
But i am indirectly calling it from CDN, so that should fix the issue right? jQuery 2.0Contra
can you share the links... the cdn links will give the versionsBrutify
@user2695925 jquery 2.0.0 and bootstrap 2.2.1 seems fine jsfiddle.net/arunpjohny/4HptX/3Brutify
can you also share the bootstrap linkBrutify
//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.jsContra
Are you testing in chrome? Because its working fine in firefoxContra
@user2695925 also can you check whether this sample is working for you jsfiddle.net/arunpjohny/4HptX/4Brutify
Should i define bootstrap.css link also? Its showing Bootstrap v2.3.2Contra
@user2695925 did you check the link I posted aboveBrutify
C
1

Quite an old question but I've been coming across this issue today where none of these answers applied to my problem. My problem was, that I've been using a tooltip on a disabled button, which is not possible according to the documentation of Bootstrap: https://getbootstrap.com/docs/4.3/components/tooltips/#disabled-elements

To handle that case, a wrapper element must be used, where the tooltip is applied to. For instance:

<span data-toggle="tooltip" title="Disabled tooltip">
  <button class="btn btn-primary" style="pointer-events: none;" type="button" disabled>Disabled button</button>
</span>

Also important is to use the style="pointer-events: none;" attribute on the disabled button. Otherwise it won't be working in Chrome neither. (Firefox seems to deal with it without the wrapper too.)

Counteraccusation answered 5/7, 2021 at 14:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.