diff --git a/docs/src/index.html.erb b/docs/src/index.html.erb index 1ca16cf..3abbff4 100644 --- a/docs/src/index.html.erb +++ b/docs/src/index.html.erb @@ -33,7 +33,7 @@ an anchor tag's title attribute.
-$('#example-1').tipsy();+
$('#example-1').tipsy();
$('#foo').tipsy({gravity: 'n'}); // nw | n | ne | w | e | sw | s | se+
$('#foo').tipsy({gravity: 'n'}); // nw | n | ne | w | e | sw | s | se
As of version 0.1.3, it's possible to use a callback function to set the gravity dynamically at hover-time. Within the callback, this
refers to the active element, and the function should return the calculated gravity as a string. Two demo callbacks are supplied - $.fn.tipsy.autoNS
and $.fn.tipsy.autoWE
- which select north/south and west/east gravity, respectively, based on the element's location in the viewport.
$('#foo').tipsy({gravity: $.fn.tipsy.autoNS});+
$('#foo').tipsy({gravity: $.fn.tipsy.autoNS});
$('#example-fade').tipsy({fade: true});+
$('#example-fade').tipsy({fade: true});
$('#example-custom-attribute').tipsy({title: 'id'});+
$('#example-custom-attribute').tipsy({title: 'id'});
If any attribute isn't good enough, you may pass a callback function instead. It should
return the tooltip text for this
element:
$('#example-callback').tipsy({title: function() { return this.getAttribute('original-title').toUpperCase(); } });+
$('#example-callback').tipsy({title: function() { return this.getAttribute('original-title').toUpperCase(); } });
Finally, it is possible to specify a fallback tooltip for any element which does not have any tooltip text:
@@ -142,7 +142,7 @@ an anchor tag's title attribute. -$('#example-fallback').tipsy({fallback: "Where's my tooltip yo'?" });+
$('#example-fallback').tipsy({fallback: "Where's my tooltip yo'?" });
If your tooltip content contains HTML, set the
html
option to true
(relies on invalid HTML, sorry):
$('#example-html').tipsy({html: true });+
$('#example-html').tipsy({html: true });
$('#example-delay').tipsy({delayIn: 500, delayOut: 1000});+
$('#example-delay').tipsy({delayIn: 500, delayOut: 1000});
Hover and wait @@ -217,11 +217,11 @@ an anchor tag's title attribute.
-<script type='text/javascript'> +@@ -241,15 +241,15 @@ an anchor tag's title attribute. -<script type='text/javascript'> $(function() { $('#focus-example [title]').tipsy({trigger: 'focus', gravity: 'w'}); }); -</script>+</script><p id='manual-example'> - <a rel='tipsy' title='Well hello there'>My tooltip is manually triggered</a> - <a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("show"); return false;'>Show</a> - <a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("hide"); return false;'>Hide</a> - </p> - - <script type='text/javascript'> - $('#manual-example a[rel=tipsy]').tipsy({trigger: 'manual'}); - </script>+@@ -271,15 +271,15 @@ an anchor tag's title attribute. -<p id='manual-example'> + <a rel='tipsy' title='Well hello there'>My tooltip is manually triggered</a> + <a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("show"); return false;'>Show</a> + <a href='#' onclick='$("#manual-example a[rel=tipsy]").tipsy("hide"); return false;'>Hide</a> +</p> + +<script type='text/javascript'> + $('#manual-example a[rel=tipsy]').tipsy({trigger: 'manual'}); +</script><script type='text/javascript'> +<script type='text/javascript'> $('a.live-tipsy').tipsy({live: true}); -</script>+</script>Summary of Configuration Options
Here is the default options declaration: -
$.fn.tipsy.defaults = { +@@ -315,4 +315,4 @@ an anchor tag's title attribute.$.fn.tipsy.defaults = { delayIn: 0, // delay before showing tooltip (ms) delayOut: 0, // delay before hiding tooltip (ms) fade: false, // fade tooltips in/out? @@ -291,7 +291,7 @@ an anchor tag's title attribute. opacity: 0.8, // opacity of tooltip title: 'title', // attribute/callback containing tooltip text trigger: 'hover' // how tooltip is triggered - hover | focus | manual -};+};github
-jason@donut ~ $ git clone git://github.com/jaz303/tipsy.git+diff --git a/docs/src/tipsy-docs.css b/docs/src/tipsy-docs.css index 011a9cc..4fc383c 100644 --- a/docs/src/tipsy-docs.css +++ b/docs/src/tipsy-docs.css @@ -1,5 +1,5 @@ #gravity { width: 100%; margin: 5px 0; border-spacing: 5px; } - #gravity td { text-align: center; vertical-align: middle; padding: 5px 0; background-color: #d0d0d0; } + #gravity td { text-align: center; vertical-align: middle; padding: 5px 0; background-color: #d0d0d0; width: 33%; } #gravity a { } #gravity a:hover { color: #505050; background: none; }jason@donut ~ $ git clone git://github.com/jaz303/tipsy.git