Permalink
Browse files

added content option

  • Loading branch information...
1 parent bd5ccc1 commit 5c643c05e223dd782201f574de5e02690768f416 pascalbetz committed Nov 16, 2009
Showing with 8 additions and 0 deletions.
  1. +8 −0 tooltips.js
View
@@ -24,6 +24,14 @@ Tooltip.prototype = {
Event.observe(this.el, "mouseover", this.showEvent );
Event.observe(this.el, "mouseout", this.hideEvent );
+ // Content for Tooltip is either given through
+ // 'content' option or 'title' attribute of the trigger element. If 'content' is present, then 'title' attribute is ignored.
+ // 'content' is an element or the id of an element from which the innerHTML is taken as content of the tooltip
+ if (options && options['content']) {
+ this.content = $(options['content']).innerHTML;
+ } else {
+ this.content = this.el.title.stripScripts().strip();
+ }
// Removing title from DOM element to avoid showing it
this.content = this.el.title.stripScripts().strip();
this.el.title = "";

0 comments on commit 5c643c0

Please sign in to comment.