Skip to content

Instantly share code, notes, and snippets.

@mileskrell
Created March 3, 2020 07:16
Show Gist options
  • Save mileskrell/15a67d34c602a31da80190c0b84bec96 to your computer and use it in GitHub Desktop.
Save mileskrell/15a67d34c602a31da80190c0b84bec96 to your computer and use it in GitHub Desktop.
Example of showing an image in a Bootstrap popover
<!-- You'll need to add all the Bootstrap stuff for this to work -->
<p>Click <a href="#" id="popover-link" data-toggle="popover">here</a> to see an image in a popover.</p>
<script>
window.onload = function () {
$("#popover-link").popover({
content: '<img src="https://via.placeholder.com/200x200" width="200" height="200" />',
trigger: "focus",
html: true
})
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment