diff options
| author | Neylor Ohmaly | 2014-02-27 23:08:39 -0300 | 
|---|---|---|
| committer | Neylor Ohmaly | 2014-02-27 23:08:39 -0300 | 
| commit | ba8432dc198541bef6fb253e97146f52505e780b (patch) | |
| tree | 6d276c2d3a19f40a52385e17ac076f21cb9c5b6c /example | |
| parent | 1a4e375236e0ec17ed1ab11e43cd950343310a82 (diff) | |
| download | nsPopover-ba8432dc198541bef6fb253e97146f52505e780b.tar.bz2 | |
Keep popover open while triggering element has mouse over it.
Diffstat (limited to 'example')
| -rw-r--r-- | example/index.css | 5 | ||||
| -rw-r--r-- | example/index.html | 23 | ||||
| -rw-r--r-- | example/nsPopover.js | 10 | 
3 files changed, 35 insertions, 3 deletions
| 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
      </a>
    </article>
 +
 +  <h1> Tooltip </h1>
 +  <article>
 +    <p>
 +      <b>nsPopover</b> 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.
 +    </p>
 +
 +    <button ns-popover
 +            ns-popover-template="menu"
 +            ns-popover-trigger="click"
 +            ns-popover-theme="ns-popover-tooltip-theme"
 +            ns-popover-timeout="1">
 +      Click Me
 +    </button>
 +
 +    <a ns-popover
 +       ns-popover-template="menu"
 +       ns-popover-trigger="mouseenter"
 +       ns-popover-theme="ns-popover-tooltip-theme">
 +      Hover me
 +    </a>
 +  </article>
  </section>
  </body>
 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) {
 | 
