jQuery UI 工具提示小部件中的 AJAX 内容 [英] AJAX content in a jQuery UI Tooltip Widget

查看:30
本文介绍了jQuery UI 工具提示小部件中的 AJAX 内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery UI 1.9 中有一个新的 Tooltip Widget,它的 API 文档 暗示 AJAX 内容可以显示在其中,但没有任何进一步的细节.我想我可以通过同步和阻塞请求来完成类似的事情,但这不是我想要的.

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.

如何让它显示通过异步 AJAX 请求检索到的任何内容?

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

推荐答案

这里是 我的博客.希望有帮助.

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**
        });
    },
});

这篇关于jQuery UI 工具提示小部件中的 AJAX 内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆