I am trying to get a boot popover to display contextual content based on which element is being configured with popover.
Here is a markup example:
<div class="user"> <img src="foo.jpg" /> </div> <div class="userInfo"> <p>He likes pie!</p> </div> <div class="user"> <img src="bar.jpg" /> </div> <div class="userInfo"> <p>He likes cake!</p> </div>
script to configure popover:
$('.user').popover({ trigger: 'hover', placement: 'top', html: true, content:
The expected result when hovering over the user class should be to show a popover displaying the content contained in the sibling or child userInfo .
My markup can be flexible; I can move the userInfo class as child, sibling, parent, etc.
source share