C
C
Crash2018-08-30 13:54:25
JavaScript
Crash, 2018-08-30 13:54:25

How to animate Bootstrap popovers after reloading part of the page using Pjax?

There is a block with a rather complex layout on the page (a Yii2 widget with a bunch of partials, I won’t give the layout), some links that are in it have popovers attached (triggered by the hover event). They clearly work until the block is updated by Pjax: Redefinition after reload did not help (the necessary attributes are written in the html code) Who faced such a problem, please tell me how to solve it. Interestingly, modals hung on other links are norms. work out.
$.pjax.reload('#my-block');
$('.link').popover();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Justique, 2018-08-30
@Bandicoot

$(document).on('pjax:complete', function(e) {
       $('.link').popover();
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question