Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added function documentation to readme.md.

  • Loading branch information...
commit 7a61cb8e436f5086f1823ed043a3ca47b475c128 1 parent a4208d3
Ronni Rasmussen authored
Showing with 45 additions and 6 deletions.
  1. +45 −6 readme.md
View
51 readme.md
@@ -13,30 +13,69 @@ Tooltip is a simple jQuery plugin for generating tooltips.
});
## Options
-* __gravity:__ Gravity priority used in order when tooltip falls out of bounds.
+* ### gravity:
+ Gravity priority used in order when tooltip falls out of bounds.
* __Type:__ `Array` or `String`
* __Default:__ `['sw', 'nw', 'se', 'ne', 'n', 's', 'e', 'w']`
-* __offset:__ Distance between element and tooltip
+* ### offset:
+ Distance between element and tooltip
* __Type:__ `Integer`
* __Default:__ `5`
-* __titleSelector:__ The selector of the title text which will be used by the plugin.
+* ### titleSelector:
+ The selector of the title text which will be used by the plugin.
* __Type:__ `String`
* __Default:__ `'title'`
-* __live:__ Define if the trigger event should be bound as a live event.
+* ### live:
+ Define if the trigger event should be bound as a live event.
* __Type:__ `Boolean`
* __Default:__ `true`
-* __trigger:__ Define what will trigger the tooltip.
+* ### trigger:
+ Define what will trigger the tooltip.
* __Type:__ `String`
* __Default__: `'hover'`
-* __className:__ Add class to the tooltip element on creation.
+* ### className:
+ Add class to the tooltip element on creation.
* __Type:__ `String`
* __Default:__ `false`
+## Functions
+Functions used to manually control the tooltip element.
+
+* ### .show()
+ Show the tooltip element.
+
+* ### .hide()
+ Hide the tooltip element.
+
+* ### .html(`text or html`)
+ Set the html contents for the tooltip element.
+
+* ### .addClass(`string`)
+ Add a CSS class to the tooltip element.
+
+* ### .removeClass(`string`)
+ Removes all or the specified class(es) from the tooltip element.
+
+* ### .setGravity(`string or array)
+ Sets the gravity of the tooltip element.
+
+> To use functions you need to initialize the tooltip on the binding element first.
+
+ $('#element-id').tooltip({trigger: 'manually'});
+
+> Then call functions by parsing the first parameter as `true` followed by the function(s).
+
+ $('#element-id').tooltip(true).show();
+
+> All functions can be nested as following.
+
+ $('#element-id').tooltip(true).html('Try this kewl jQuery tooltip plugin.').addClass('tooltip-plugin').show();
+
## Contributing
__1.__ Fork it.
__2.__ Make changes.
Please sign in to comment.
Something went wrong with that request. Please try again.