我正在尝试让 Bootstrap 2“弹出框”:
A)使用动态生成的内容和
B)在弹出框内显示图像。
我当前的代码:
var image = '<img src="img/header/'+selection+'" />';
var previewLink = '<a class="headerPreview" href="#" rel="popover" >(Hover to Preview) </a>';
$('#headerBlock').append(previewLink);
$('.headerPreview').popover({
title: 'test',
content: image
});
现在,当链接悬停在上面时,它什么也不做。我不确定我做错了什么。