简体   繁体   中英

Show bootstrap tooltip after $().show()

From bootstrap:

Don't try to show tooltips on hidden elements

Invoking $(...).tooltip('show') when the target element is display: none; will cause the tooltip to be incorrectly positioned.

But what happens if I first $('el').show(); then $('el tooltips).tooltip()?

Why it still does not work?

This may be an issue with your css, check this , however if you just want to make sure that your code is executed exactly after the element is shown, then use this code

$(yourElement).show(0, function () {
 $(this).find('.tooltips').tooltip();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM