Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: No method named "destroy" for popover bootstrap

I want to close popover automatically after a delay time. but its showing an error error image

$('#prev_button').popover('show');

$('#prev_button').on('shown.bs.popover', function() {
  var $pop = $(this);

  setTimeout(function() {
    $pop.popover('destroy');
  }, 1000);
});

bootstrap.bundle.js is included to ensure popover method works. Can't figure out a solution

PS: using v4.1 bootstrap

like image 935
Achal Gupta Avatar asked Aug 22 '18 05:08

Achal Gupta


People also ask

How do you destroy popovers?

Use the popver(“detroy”) to destroy the popover.

What is bootstrap popover?

The Popover plugin is similar to tooltips; it is a pop-up box that appears when the user clicks on an element. The difference is that the popover can contain much more content. Click To Toggle Popover Click To Toggle Popover. Tip: Plugins can be included individually (using Bootstrap's individual "popover.


1 Answers

As of version 4.1, the method destroy has been replaced by dispose. You can find more details here.

$pop.popover('dispose');
like image 137
31piy Avatar answered Oct 14 '22 01:10

31piy