femaref / jQuery-tipTip

a simple tooltip plugin for jQuery. Original code by Drew Wilson (see readme for details)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This plugin is originally by Drew Wilson (http://code.drewwilson.com/entry/tiptip-jquery-plugin).

The whole documentation still applies, however you now are able to select the content of the tooltip via the enter callback:

    <a class="js_tiptip">Foo
      <span class="hidden">Bar
      </span>
    </a>

    $(function() {
      $(".js_tiptip").tipTip({
        enter: function() {
          return $(this).find("span").html();
        }});                      
    });

This will create a normal tipTip tooltip, fetching the content from the inner span element of the anchor tag. You aren't confined
to elements already in the DOM, you can easily request the content via ajax.

If you don't want to set the content of the tooltip, but still want to use the callback to do something, return nothing:

    <a class="js_tiptip" title="foz">Foo
      <span class="hidden">Bar
      </span>
    </a>

    $(function() {
      $(".js_tiptip").tipTip({
        enter: function() {
          doSomething();
        }});                      
    });
    

This will create a tooltip, using the default behaviour of tipTip, by fetching the content from the title tag.

About

a simple tooltip plugin for jQuery. Original code by Drew Wilson (see readme for details)