-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Closed
Description
I have the following JavaScript/jQuery code that creates and initializes a number of Bootstrap popovers.
I need the text to be updated each time it is shown, so I thought being able to set content to a function would be perfect. However, this function only gets called once per popover. So instead of updating each time it is displayed, it just keeps showing its initial value.
// Initialize example conversion popovers
$('img.example-conversion').each(function() {
new bootstrap.Popover(this, {
placement: 'right',
trigger: 'click focus',
html: true,
title: 'Quantity Divisor',
content: getPopoverContent,
});
})
var count = 1;
function getPopoverContent() {
return count++;
}
I need to update the text every time it is displayed. Does anyone know how to make that work?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels