Last active
December 19, 2015 05:18
-
-
Save jeremymouton/5902858 to your computer and use it in GitHub Desktop.
A better and more user-friendly popover script for Twitter Bootstrap.
Easier closing of popover, and only one popover open at one time (to fix overlapping popovers).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( function() { | |
$('html').click(function(e) { | |
$("[rel='popover']").filter(function(index, el) { return el != e.target; }).popover('hide'); | |
}); | |
$("[rel='popover']").popover({ | |
html: true, | |
trigger: 'manual' | |
}).click(function(e) { | |
$("[rel='popover']").filter(function(index, el) { return el != e.target; }).popover('hide'); | |
$(this).popover('toggle'); | |
e.stopPropagation(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment