From ba8432dc198541bef6fb253e97146f52505e780b Mon Sep 17 00:00:00 2001 From: Neylor Ohmaly Date: Thu, 27 Feb 2014 23:08:39 -0300 Subject: Keep popover open while triggering element has mouse over it. --- example/index.css | 5 +++++ example/index.html | 23 +++++++++++++++++++++++ example/nsPopover.js | 10 +++++++--- 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'example') diff --git a/example/index.css b/example/index.css index 49bae04..d641f03 100644 --- a/example/index.css +++ b/example/index.css @@ -40,9 +40,14 @@ article { float: left; } +article:after { + clear: both; +} + h1 { border-bottom: solid 1px #b9b8bb; padding-bottom: .5em; + display:block; } a { diff --git a/example/index.html b/example/index.html index dcf33fd..28ff4fe 100644 --- a/example/index.html +++ b/example/index.html @@ -53,6 +53,29 @@ Hover me + +

Tooltip

+
+

+ nsPopover could be used as a simple dropdown menu. You can use the built-in "ns-popover-list-theme" to + style the popover as a dropdown or create a custom one. +

+ + + + + Hover me + +
diff --git a/example/nsPopover.js b/example/nsPopover.js index cfdb904..505fbba 100644 --- a/example/nsPopover.js +++ b/example/nsPopover.js @@ -140,9 +140,13 @@ }); }); - elm.on('mouseout', function() { - hider_.hide($popover, options.timeout); - }); + elm + .on('mouseout', function() { + hider_.hide($popover, options.timeout); + }) + .on('mouseover', function() { + hider_.cancel(); + }); $popover .on('mouseout', function(e) { -- cgit v1.2.3