Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
Popover - placement option only work one time when all made i C#

I am trying to use Bootstrap popover where the popover is shown either at the top or the bottom, activated by mouseenter event. Works well the first time. When the popover is hidden, page scrolled down & popover reopened, the new placement should be altered based on the new position. But it fails to change the position. The popovers are made in C# producing this HTML code:


    Blah Blah Blah " data-original-title="Referanse">Blah

Works nice. Sorry for the BAD HTML code shown. It is not so important, and I am new to the forum. The HTML code seems not to be the problem. The problem is the positioning when the page is scrolled. It will place it based on this simple javascript mouseenter code:

// Place the popover based on the target client rect
// This method has a flaw, thus not implemented.
// The popover method has its method created in HTML only one time
// when it is shown for the first time. When it is hidden, then shown
// the placement option is not changed, regardless of below code. Need more
// investigation to resolve.
var popRect = e.target.getBoundingClientRect();
if (popRect.y < 150) {
    $(e.target).popover({ placement: "bottom" });
    console.log('bottom');
} else {
    $(e.target).popover({ placement: "top" });
    console.log('top');
}
$(e.target).popover('show');

It seems that the HTML popover insert are created only one time. Can anybody help with this issue?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda