0

I'm using cluetip for tooltips in my web site, and I want to set the tooltip text based on the link url.

For example: I have a link on my page to "http:abc.com/display?content=sweeties" and I want the tooltip to read "sweeties"

Someone show me how, please?

annakata
  • 74,572
  • 17
  • 113
  • 180
gacon
  • 2,075
  • 4
  • 21
  • 32
  • before you feel like upvoting this read revision 0 :) – annakata May 14 '09 at 07:53
  • Now I have fixed this by using rel, in cluetip if you want to load content from the element inside the local page you just define it in the rel attribute like this:"rel="div#idName" and the content in the div with idName you declare above in rel attribute. For the content load from url you do the same in url point to the page you want to load and change option in cluetip local:false like this $('a.className').cluetip( local:false ); – gacon Jun 04 '09 at 06:30

3 Answers3

1

You should set the title of your link to "sweeties" and then instruct whatever tooltiping plugin to use actually the title attribute for content.

I think it could work with cluetip out of the box.

Rashack
  • 4,667
  • 2
  • 26
  • 35
  • I read on cluetip API/option and they point out that using rel attribute in anchor to get the path to the content. I'm not try to change the default option of them. I think you mean the title in cluetip will load the title content in anchor, aren't you? – gacon Jun 04 '09 at 07:22
0

One undocumented, nice, and staight forward way to do this is using a function as the first argument in cluetip call, that returns your desired content:

var normalcluetipsettings = {.. ... ... ... }
$('#mydiv').cluetip(function(){return 'hello'+' '+'world';}, normalcluetipsettings)
Saic Siquot
  • 6,513
  • 5
  • 34
  • 56
0
var a = $("aTagsId");
var content = a.attr('href').match(/content\=([^\&]*)/)[1];
a.attr('title', content);
... setup cluetip w/ title...
Tracker1
  • 19,103
  • 12
  • 80
  • 106
  • Now I don't have time to try your code but I think It's work, thank you anyway Tracker1! – gacon Jun 04 '09 at 07:20