1

I am using cluetip to show a tooltip when a user hovers over a link in my aspx page. I want this cluetip to show content from the database. I don't know how to do it.

My code:

 $(document).ready(function () {$('a.title').cluetip
({   splitTitle: '|' });
    });

Aspx code: <a class="title" href="#" title="This is the title|Work Experience">Previous Exp</a>

I would want to get the data from the database in the content of the cluetip.Any help would be much appreciated.

blake305
  • 2,196
  • 3
  • 23
  • 52
user728148
  • 159
  • 1
  • 6
  • 19

1 Answers1

0

There is a demo on the cluetip plugin website that suggests this syntax for ajax-based cluetips:

<a class="basic" href="ajax.html" rel="ajax.html">

Yours would be:

<a class="title" rel="ajax.php" href="#" title="This is the title|Work Experience">Previous Exp</a>

where ajax.php is replaced with an asp page that returns what you want to display in the cluetip.

Edit: You also have to remove the split title functionality.

<a class="title" rel="ajax.php" href="#" title="Work Experience">Previous Exp</a>


$(document).ready(function () {
  $('a.title').cluetip();
});
Kevin B
  • 94,570
  • 16
  • 163
  • 180
  • Thanks. I want to show the content in the cluetip based on the users data.Hence, instead of using a 'rel' attribute, is there a way to query the database using a
    tag or by some other means?
    – user728148 Jan 10 '12 at 19:00
  • no, you have to do it through the rel attribute. http://plugins.learningjquery.com/cluetip/demo/ keep in mind you can pass an id through the url in the rel attribute, such as `rel="ajax.php?id=77256"` – Kevin B Jan 10 '12 at 19:03
  • Thanks. It worked when the link is clicked. But, on hover, I am still unable to generate dynamic content.. – user728148 Jan 10 '12 at 21:07
  • You have to remove the split title functionality, that make's it ignore the rel attribute. – Kevin B Jan 10 '12 at 21:19