我试图根据div的左右位置来定位我的弹出窗口,但我无法做到这一点 .

底部图像显示了我面临的问题

Popover going behind the right div

我对popover的代码如下: -

$('a[rel=popover]').popover({
                html: true,
                trigger: 'hover',
                trigger: 'click',
                placement: 'right',
                template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title" style="display:none;"></h3><div class="popover-content"><p></p></div></div></div>',
                content: function () { return '<img style="width:250px" src="' + $(this).data('img') + '" />'; }
            });

我尝试使用展示位置作为以下链接中建议的功能: -

https://stackoverflow.com/questions/9956958/changing-the-position-of-bootstrap-popovers-based-on-the-popovers-x-position-in‏

Is it possible to change the position of Bootstrap popovers based on screen width?

这些都行不通 .

IMPORTANT 显示给您的图像位于fancybox中