Seeking a way to dynamically populate a popover
through
JAVASCRIPT
$("[data-bind='popover']").popover({
trigger: 'hover',
html: true,
content: function(){
return "<img src="+$(this).data('content')+" />";
};
});
HTML
<a href="myreference.html" data-bind="popover" data-content="mylinktoimage">Brick</a>
An issue arises when trying to set the width
and height
attributes for the img
element within the JavaScript. The popover
fails to display properly in this scenario. However, if these attributes are not set, the anchor <a>
experiences a "vibrating" pointer cursor, preventing the popover
from appearing. What could be causing this problem?