M
M
Mikhail Derkach2018-08-27 19:40:51
Bootstrap
Mikhail Derkach, 2018-08-27 19:40:51

Popover: fix position?

Good evening.
Connected bootstrap 4. I use an informer (popover) with iframe display inside
Problem: data-placement="bottom" does not work properly - depending on the position inside the window, the popover is displayed either above or below the call button.
Those. if it does not have enough space to display at the bottom of the screen, then it opens at the top. If you scroll with an initialized popover, then as soon as there is enough space, it moves down.
Task: hard force it to be displayed at the bottom, regardless of the conditions
I initialize the popover via js:

$(elem).popover({
        trigger: 'click',
        type: 'button',
        placement: 'bottom',
        html: true,
        content: '<p>Бла-бла</p>',
    });

Duplicating the data-placement in the button doesn't help. I turned to the documentation, but it is not clear whether it is possible to attach to events from the documentation and what exactly needs to be removed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2018-08-28
@skeevy

I looked at the documentation but it's not clear

It's not clear - I explain: you need to disable the fallbackPlacement.
$('.....').popover({
  placement: 'bottom',
  fallbackPlacement: [], // <--
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question