|How to dismiss a Twitter Bootstrap popover by clicking outside?||Ante Vrli via StackOverflow||7/28/12 10:17 AM|
Can we get popovers to be dismissable in the same way as modals, ie. make them close when user clicks somewhere outside of them?
Unfortunately I can't just use real modal instead of popover, because modal means position:fixed and that would be no popover anymore. :(
Please DO NOT REPLY directly to this email but go to StackOverflow:
|How to dismiss a Twitter Bootstrap popover by clicking outside?||Pigueiras via StackOverflow||7/28/12 10:42 AM|
I made a jsfiddle to show you how to do it:
The idea is to show the popover when you click the button and to hide the popover when you click outside the button.
|How to dismiss a Twitter Bootstrap popover by clicking outside?||Sherbrow via StackOverflow||7/28/12 11:12 AM|
This is basically not very complex, but there is some checking to do to avoid glitches.