【发布时间】:2020-03-07 12:17:49
【问题描述】:
这似乎是多次询问的问题,但我无法在我的情况下使用它。
我有一个表格,其中包含带有背景颜色集的 td 元素。
当我设置弹出框(具有标题和内容图像)时,我想将标题设置为与 td 元素具有相同的背景颜色。
我正在使用 jquery 和 bootstratp 3.3.7 并且到目前为止有以下代码(工作正常)
...
$('td').hover(function(){
// mousein
$(this).popover({
animation: true,
container: 'body',
content : $(this).attr("popover-content"),
title : $(this).attr("popover-title"),
placement : "right",
html : "true",
trigger : "manual",
});
$(".popover-title").css('background-color',$(this).css('background-colo
r')+' !important');
$(this).popover('show');
},function(){
// mouseout
$(this).popover('hide');
});
...
不起作用的是对类 popover-title 上的 css 的更改。
我一定遗漏了一些重要的东西,希望能得到一些帮助吗?
谢谢,保罗
【问题讨论】:
标签: jquery css twitter-bootstrap popover