有没有办法让 i 从翻转区域触发多个弹出框

Is there a way the i can trigger multiple popovers from on roll over area?

本文关键字:区域 翻转 有没有      更新时间:2023-09-26

基本上,我尝试多次调用相同的JavaScript函数以触发多个弹出窗口。

任何帮助将不胜感激:)

Javascript:

$(function(){
$('[rel="popover"]').popover({
    container: 'body',
    html: true,
    content: function () {
        var clone = $($(this).data('popover-content')).clone(true).removeClass('hide');
        return clone;
    }
}).click(function(e) {
    e.preventDefault();
});

.HTML

<a href="#" rel="popover" title="Popover Title" data-placement="top"data-trigger="hover" data-popover-content="#Popover_Content">
<div id="Popover_Content" class="hide">
Popover Content
</div>
<area shape="rect" name="Rollover_Area"    coords="378,439,491,462"    href="#">

</a> 

.CSS

#Popover{
position: relative;
bottom: 500px;
left: 500px; }

我认为您在此代码片段中询问此函数 https://jsfiddle.net/68k33bqh/1/

function attachPopover(e){
$(e).popover({
      html:true,
      content:function(){
      var a = $(e).clone();
      attachPopover(a[0]);
      return a;
}});
}
attachPopover($('[data-toggle="popover"]')[0]);
$(document).click(function(e){
    if($('[data-toggle="popover"]').index(e.target)>-1) attachPopover(e.target);
});