diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-10-26 17:07:22 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-10-26 17:07:22 +0200 |
commit | 48a5977d3325869abd7b7ba835eb8ac331fd6eb5 (patch) | |
tree | 43fd0cda4af2cdcd33f5f2ae8205b13100caca83 /ui/jquery.ui.tooltip.js | |
parent | bdd815e8dcdeace8be6dd8005ef443bc5ea20548 (diff) | |
download | jquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.tar.gz jquery-ui-48a5977d3325869abd7b7ba835eb8ac331fd6eb5.zip |
Tooltip: Implementing event delegation support.
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r-- | ui/jquery.ui.tooltip.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index 91c60d603..122652bb0 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -18,6 +18,7 @@ var increments = 0; $.widget("ui.tooltip", { options: { + items: "[title]", content: function() { return $(this).attr("title"); }, @@ -41,10 +42,10 @@ $.widget("ui.tooltip", { .appendTo(this.tooltip); this.opacity = this.tooltip.css("opacity"); this.element - .bind("focus.tooltip mouseenter.tooltip", function(event) { + .bind("focus.tooltip mouseover.tooltip", function(event) { self.open( event ); }) - .bind("blur.tooltip mouseleave.tooltip", function(event) { + .bind("blur.tooltip mouseout.tooltip", function(event) { self.close( event ); }); }, @@ -67,7 +68,7 @@ $.widget("ui.tooltip", { }, open: function(event) { - var target = this.element; + var target = $(event && event.target || this.element).closest(this.options.items); // already visible? possible when both focus and mouseover events occur if (this.current && this.current[0] == target[0]) return; |