Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've been having a play about with this and there's a few other problems regarding triggering the manual show/hide to get this to play nicely. Hover is actually <code>mousein</code> and <code>mouseout</code> and unless you add in some additional checks, you will come across the problems that I just did!</p> <p><a href="http://jsfiddle.net/sEKtD/111/">Here is my solution in action</a> and I'll try to explain what I've done.</p> <pre><code>$(function () { var overPopup = false; $('[rel=popover]').popover({ trigger: 'manual', placement: 'bottom' // replacing hover with mouseover and mouseout }).mouseover(function (e) { // when hovering over an element which has a popover, hide // them all except the current one being hovered upon $('[rel=popover]').not('#' + $(this).attr('id')).popover('hide'); var $popover = $(this); $popover.popover('show'); // set a flag when you move from button to popover // dirty but only way I could think of to prevent // closing the popover when you are navigate across // the white space between the two $popover.data('popover').tip().mouseenter(function () { overPopup = true; }).mouseleave(function () { overPopup = false; $popover.popover('hide'); }); }).mouseout(function (e) { // on mouse out of button, close the related popover // in 200 milliseconds if you're not hovering over the popover var $popover = $(this); setTimeout(function () { if (!overPopup) { $popover.popover('hide'); } }, 200); }); }); </code></pre> <p>This worked perfectly for me with the following html:</p> <pre><code>&lt;a href="#" id="example1" class="btn large primary" rel="popover" data-content="Example 1!!!" data-original-title="Example 1 title"&gt;Button 1&lt;/a&gt; &lt;a href="#" id="example2" class="btn large primary" rel="popover" data-content="Example 2!!!" data-original-title="Example 2 title"&gt;Button 2&lt;/a&gt; &lt;a href="#" id="example3" class="btn large primary" rel="popover" data-content="Example 3!!!" data-original-title="Example 3 title"&gt;Button 3&lt;/a&gt; </code></pre> <p>Hope that sorts you out :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload