You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Tooltip appearing when no title attribute exists Created Jan 4, 2010

This thread is solved

Views: 1942     Replies: 2     Last reply Jan 6, 2010  
You must login first before you can use this feature

geebee

Posts: 2

Registered:
Jan 4, 2010

Tooltip appearing when no title attribute exists

Posted: Jan 4, 2010

A blank tooltip box appears when there is no "title" attribute in my link.

For example the link might look like this:-

<a  href="http://www.yahoo.com" class="tooltiplink">yahoo</a>

I need to ensure that when there is no title attribute or if the attribute is an empty string the tooltip is not displayed.

Do I need to write my own onBeforeShow function to handle this? I would have thought most developers would want this behaviour by default.

Any help much appricated.

degenerate

Posts: 156

Registered:
Sep 19, 2008

» Tooltip appearing when no title attribute exists

Posted: Jan 6, 2010

Reply to: Tooltip appearing when no title attribute exists, from geebee
You just need to modify your initialization of the tooltip, so instead of putting tooltips on all elements of class "tooltiplink" you need to select that class which does also contains a "title" attribute. You probably have something like:
$('.tooltiplink').tooltip();
When you need
$('.tooltiplink [title]').tooltip();

Please mark this thread solved if this solves your problem.

geebee

Posts: 2

Registered:
Jan 4, 2010

» » Tooltip appearing when no title attribute exists

Posted: Jan 6, 2010

Reply to: » Tooltip appearing when no title attribute exists, from degenerate
Perfect thanks!