dynamic change content of bootstrap tooltip or popover
2015-08-20 14:18
633 查看
f you grab the popover instance like this:
Then, to redraw the popover, use the
I found out browsing the source: https://github.com/twitter/bootstrap/blob/master/js/popover.js
So, in your example, try:
Update
The
also removes the placement class, so you should do:
Demo: http://jsfiddle.net/44RvK
var popover = $('.reply').data('bs.popover');
Then, to redraw the popover, use the
.setContent()method:
popover.setContent();
I found out browsing the source: https://github.com/twitter/bootstrap/blob/master/js/popover.js
So, in your example, try:
thisVal.attr('data-content',data).data('bs.popover').setContent();
Update
The
setContent()method
also removes the placement class, so you should do:
var popover = thisVal.attr('data-content',data).data('bs.popover'); popover.setContent(); popover.$tip.addClass(popover.options.placement);
Demo: http://jsfiddle.net/44RvK
相关文章推荐
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- bootstrap 图标 由Glyphicons提供
- BootStrap弹窗
- 玩转Bootstrap(基础) (1.基础知识)
- bootstrap button按钮长度
- bootstrap3 input 输入框图标背景
- bootstrap注意事项(四)表格
- bootstrap注意事项(三)
- Bootstrap--组件之按钮组
- bootstrap -- 一个标签中,同时有 col-xs , col-sm , col-md , col-lg
- daterangepicker-bootstrap之双日历时间段选择控件(汉化版)
- bootstrap学习笔记二
- 从第一眼你就会爱上的bootstrap UI资源(下载)。
- Metronic 定制主题
- bootstrap注意事项(二)
- bootstrap注意事项(一)
- BootStrap基本样式
- bootstrap,select
- 认识Bootstrap
- bootstrap3 char.js 使用