I'm using bootstrap v2.2.2. I've tried a few other methods (namely: close popover outside popover but inside stay open and How to dismiss a Twitter Bootstrap popover by clicking outside? also tried Boot strapX clickover plugin: https://stackoverflow.com/a/11029479/1043817) But I cannot get it working via those methods.
I've created a JSFiddle with the way I have the code being used on my page: http://jsfiddle.net/FYNLL/ (Though I am using v2.2.2, The JSFiddle is using JS from v2.0.2. I think there are some differences in these version. When I use v2.2.2 locally, popover isn't displayed until I've clicked on the link. In the JSFiddle it is being displayed on hover. To be clear I want it displayed after a link has been clicked, not on hover)
What I am trying to accomplish is to hide the popover whenever an area outside of the popover is clicked. If another popover link is clicked I'd like the first popover to close and the one being clicked on to open.
Also this isn't absolutely necessary but I cannot get popover
to work when it is in the .js file (I've tried using .each()
). I'd really like to get rid of <script> $(function () { $("a[rel=popover]").popover(); });</script>
from my HTML files. Again, this isn't really a priority.