Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] QTip content from existing div element on page?
23rd November, 16:20
Post: #1
QTip content from existing div element on page?
Is it possible to load the content of the qtip from an existing div element on the page?

Something like this:

<div style="display:none;">
<table>
<tr><td>NT</td></tr>
<tr><td>0</td></tr>
<tr><td>1</td></tr>
...
</table>
</div>

The tooltip content could either be just the table contained within the div or the whole thing...

Thanks (and sorry if this question has already been answered here... I did look and didn't find anything)
Find all posts by this user
Quote this message in a reply
23rd November, 16:27
Post: #2
[Solved] QTip content from existing div element on page?
Hi dcash,

You sure can. Simply provide the content attribute a jQuery DOM array instead of some text:

JS Code
$('.selector').qtip({ content: $('table:first') }); // Clone first table element for tooltip content


Note: This method clones the element. If you want to simply append it i.e. remove the old one, add a .remove() command to the end of the content selector like so:

JS Code
$('.selector').qtip({ content: $('table:first').remove() }); // Append first table element for tooltip content


Check the documentation for more details on it here: http://craigsworks.com/projects/qtip/doc...ntent-text

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
23rd November, 16:41
Post: #3
QTip content from existing div element on page?
Thanks!!

That's what I needed!!
Find all posts by this user
Quote this message in a reply
7th December, 23:45
Post: #4
RE: QTip content from existing div element on page?
Hi,

Is it possible to turn an existing DOM element to a qtip without cloning it? I need to keep the events tied the DOM element

Thanks
Find all posts by this user
Quote this message in a reply
8th December, 18:29
Post: #5
RE: QTip content from existing div element on page?
Unfortunately no, at least not in qTip 1.0. In qTip2 passing a jQuery object simply appends those DOM elements to the tooltip, preserving the bound events, though.

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] Dynamic Content From Page Element frogg3862 2 91 3rd May 17:12
Last Post: frogg3862
  [Solved] Multiple qtips on one page, content disappearing russau 3 123 3rd May 16:38
Last Post: Craig
  [Solved] qtip showing content from db doesn't change when content in db changes. vtoepel 2 145 23rd April 16:02
Last Post: vtoepel
  [Solved] Center tooltip on page and also use a thumb image to popup the real image ChileCaliente 2 257 26th March 22:54
Last Post: ChileCaliente
  [Solved] qTip Ajax data for text in a div akhil_csit 1 316 14th March 19:27
Last Post: Craig
  can't hide qtip in a “position: absolute;” div shdog 1 281 14th March 17:35
Last Post: Craig
  calling .html using the element id matthearn 0 309 24th February 15:08
Last Post: matthearn
  [Solved] Attach QTIP to any element with attribute "tooltip" slhilbert 7 405 15th February 14:44
Last Post: slhilbert
  [Solved] Jump to top of the page snicker 4 1,307 15th February 03:31
Last Post: phpmysqlguy
  [Solved] How to append QTip to some other element instead of document body prateekbansal 2 501 11th January 07:01
Last Post: prateekbansal



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