Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's my take: <a href="http://jsfiddle.net/WojtekKruszewski/Zf3m7/22/">http://jsfiddle.net/WojtekKruszewski/Zf3m7/22/</a></p> <p>Sometimes while moving mouse from popover trigger to actual popover content <em>diagonally</em>, you hover over elements below. I wanted to handle such situations – as long as you reach popover content before the timeout fires, you're safe (the popover won't disappear). It requires <code>delay</code> option.</p> <p>This hack basically overrides Popover <code>leave</code> function, but calls the original (which starts timer to hide the popover). Then it attaches a one-off listener to <code>mouseenter</code> popover content element's.</p> <p>If mouse enters the popover, the timer is cleared. Then it turns it listens to <code>mouseleave</code> on popover and if it's triggered, it calls the original leave function so that it could start hide timer.</p> <pre><code>var originalLeave = $.fn.popover.Constructor.prototype.leave; $.fn.popover.Constructor.prototype.leave = function(obj){ var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) var container, timeout; originalLeave.call(this, obj); if(obj.currentTarget) { container = $(obj.currentTarget).siblings('.popover') timeout = self.timeout; container.one('mouseenter', function(){ //We entered the actual popover – call off the dogs clearTimeout(timeout); //Let's monitor popover content instead container.one('mouseleave', function(){ $.fn.popover.Constructor.prototype.leave.call(self, self); }); }) } }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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