Popover does not get anchored to the triggering element

前端 未结 2 1947
悲哀的现实
悲哀的现实 2021-01-03 01:43

So my Twitter Bootstrap popovers seem to be positionally challenged when the triggering element is contained within an element with the style

2条回答
  •  借酒劲吻你
    2021-01-03 02:11

    For BS 3 and above

    you can use container: $(element)

    Example:

    let elem = $(this)
    $(elem).popover({
        selector: '[rel=popover]',
        trigger: 'hover',
        container: $(elem),
        placement: 'bottom',
        html: true,
        content: 'Popover Content'
    });
    

提交回复
热议问题