Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Using Complex HTML as Tooltip Content
2nd November, 23:33
Post: #1
[Solved] Using Complex HTML as Tooltip Content
I'm just missing a step in understanding how to use existing divs on my page as the content for various tooltips. What I'm trying to do is have a tooltip for each table cell in my services table, and when hovering over each one, its unique corresponding tooltip containing HTML code is displayed. I need to be able to include links, photos and copy like on the

What is the code to tell jQuery to go through each div with a class ".tooltipcontent" and make the divs the content of each tooltip in order?
Find all posts by this user
Quote this message in a reply
3rd November, 02:07
Post: #2
RE: Using Complex HTML as Tooltip Content
Try this out:

JS Code
$('td.selector').each(function() { // Notice the use of the .each() loop
   $(this).qtip({
      content: $(this).html() // Can now reference the HTML content using "this" keyword to reference the element
   });
});

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] Take tooltip content from the element attributes AndyG 17 16,083 31st January 07:14
Last Post: eggpoker
  Load an HTML Page Within qTip Tooltip BruceBruce 3 3,327 19th January 12:17
Last Post: Craig
  How customize content modal tooltip? dannythegreat 7 3,204 25th December 16:49
Last Post: Spoonless Eddie
  How to remove created HTML? kenan 10 2,471 24th December 12:58
Last Post: kenan
  Use hovered element's own HTML for qtip content discern 2 3,721 10th December 13:52
Last Post: discern
  Accessing cloned tooltip content root66 2 1,403 29th June 16:23
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)