先贴上最终效果图
image.png
参考的菜鸟教程地址 https://www.runoob.com/bootstrap/bootstrap-tooltip-plugin.html
要求:
- 合成失败时,增加鼠标移入显示悬停信息(信息也从接口读取)
上代码,我是bootstarp渲染的列表页
$(function () { $("[data-toggle='popover']").popover(); });
<span data-toggle="tooltip" data-placement="right" title="此处是提示信息">合成失败</span>
教程里写 data-placement="right"是弹框显示的方位,但是我换top,bottom都依旧是在下方,我就先这样吧
就这两行代码!!!!我琢磨了一两个小时,冲~
还有一种Bootstrap 的弹出框(Popover)插件,这种是点击的
参考地址https://www.runoob.com/bootstrap/bootstrap-popover-plugin.html