// to enable tooltips with the default configuration $('[data-bs-toggle="tooltip"]').tooltip() // to initialize tooltips with given configuration $('[data-bs-toggle="tooltip"]').tooltip({ boundary: 'clippingParents', customClass: 'myClass' }) // to trigger the `show` method $('#myTooltip').tooltip('show')
Optionally using jQuery
You don’t need jQuery in Bootstrap 5, but it’s still possible to use our components with jQuery. If Bootstrap detects in the object, it’ll add all of our components in jQuery’s plugin system. This allows you to do the following:jQuery
window
推荐使用原生js,需要使用jQuery时需要按上面代码中的方式调用
官方文档:JavaScript · Bootstrap v5 中文文档 v5.3 | Bootstrap 中文网 (bootcss.com)
翻译
搜索
复制
标签:jQuery,show,Bootstrap,tooltip,toggle,报错,reading From: https://www.cnblogs.com/liangguangqing/p/17292510.html