Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AJAX content in a jQuery UI Tooltip Widget

There is a new Tooltip Widget in jQuery UI 1.9, whose API docs hint that AJAX content can be displayed in it, but without any further details. I guess I can accomplish something like that with a synchronous and blocking request, but this isn't what I want.

How do I make it display any content that was retrieved with an asynchronous AJAX request?

like image 429
sanmai Avatar asked Nov 01 '12 10:11

sanmai


1 Answers

Here is a ajax example of jqueryui tootip widget from my blog.hope it helps.

$(document).tooltip({     items:'.tooltip',     tooltipClass:'preview-tip',     position: { my: "left+15 top", at: "right center" },     content:function(callback) {         $.get('preview.php', {             id:id         }, function(data) {             callback(data); //**call the callback function to return the value**         });     }, }); 
like image 75
ZHAO Xudong Avatar answered Sep 29 '22 08:09

ZHAO Xudong