Ben Goodman
Ben Goodman

Reputation: 55

How do I show Tipsy tooltip on load and keep it shown?

I've just installed Tipsy Tooltip (http://onehackoranother.com/projects/jquery/tipsy/) script on my wordpress site, I'm just wondering how I go about showing the tooltip on page load and keeping it shown.

This is the code I have so far;

<a id="logo" href="#" original-title="Happy <?php echo date("l"); ?>"></a>
<script type='text/javascript'>
  $("a#logo").tipsy('show');
</script>

Thanks in advance! :)

Upvotes: 3

Views: 1628

Answers (2)

Max Allan
Max Allan

Reputation: 640

Well, first you have to specify the attribute you want to use instead of title, in your case original-title. Then the trigger must be set to manual. And last we want to show the tooltip, when this is done.

 $('#logo').tipsy({trigger: 'manual', title: 'original-title'});
 $('#logo').tipsy('show');

Upvotes: 4

Bogdan Rybak
Bogdan Rybak

Reputation: 2117

Use document ready method:

$(document).ready(function() {
  $("a#logo").tipsy('show');
});

Upvotes: 0

Related Questions