jQuery qTip &厚盒

发布于 2024-09-08 19:37:49 字数 1769 浏览 8 评论 0原文

我在 Thickbox 中加载了一个表单,它是使用 AjaxForms 提交的,我正在尝试添加一些不错的 qTips,以便用户更好地了解表单字段在输入数据时的作用(它是一个配置选项模式对话框

)东西工作正常,ThickBox 弹出,表单显示并提交正常。但是我似乎无法在任何元素上显示 qTip。我已经成功地通过使用 Firebug 控制台手动附加它来使其工作。

我已将用于扩展“高级”面板和 qtip 的代码放置到加载到 ThickBox 中的页面中,并且 jQuery 1.4.2 在项目中全局加载。

<script type="text/javascript" src="js/jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript">
$(function(){
        $('div#advanced').hide();
        $('#advtoggle').click(function(e){
            e.preventDefault();
            $('div#advanced').toggle();
        });

        $('#theme').qtip({
            content: "Default theme id, 7 for a custom window",
            position: {
                corner: {
                    target: 'topRight',
                    tooltip: 'bottomLeft'
                }
            },
            style: {
                name: 'cream',
                tip: true
            }
        });
});
</script>

我可以毫无问题地扩展面板,但我很困惑为什么我的 qTip 不会显示。

我的第一个想法是 qTip 无法初始化,因为厚盒没有打开,因此 dom 还不存在,但它是简写的 ready() 所以应该没问题。我尝试删除ready,也尝试将代码移动到父页面中,但都没有给出任何结果。

任何想法将不胜感激! Ta

PS,

在Firebug中添加它现在似乎会抛出此错误,

>>> $('#theme').qtip();
TypeError: f(this).data("qtip") is null { message="f(this).data("qtip") is null", more...}

I have a form loading in a Thickbox, which is submitted using AjaxForms and I'm trying to add some nice qTips to give users a better understanding of what the form field does when they enter data (it's a configuration options modal dialog)

The existing stuff works fine, the ThickBox pops and the form displays and submits okay. However I cannot seem to get a qTip to display on any elements. I have managed to get one working by manually attaching it using the Firebug console.

I have placed the code for expanding the 'advanced' panel and the qtip into the page loaded into the ThickBox, and jQuery 1.4.2 is loaded globally in the project.

<script type="text/javascript" src="js/jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript">
$(function(){
        $('div#advanced').hide();
        $('#advtoggle').click(function(e){
            e.preventDefault();
            $('div#advanced').toggle();
        });

        $('#theme').qtip({
            content: "Default theme id, 7 for a custom window",
            position: {
                corner: {
                    target: 'topRight',
                    tooltip: 'bottomLeft'
                }
            },
            style: {
                name: 'cream',
                tip: true
            }
        });
});
</script>

I can expand the panel without issue, but I'm very confused as to why my qTip will not display.

My first thoughts were that the qTip couldn't initialise because the thickbox wasn't open and therefore the dom doesn't exist yet, but it's in a shorthand ready() so that should be okay. I tried removing the ready and also tried moving the code into the parent page, neither of which gave any results.

Any ideas would be greatly appreciated!
Ta

PS,

Adding it in Firebug seems to throw this error now,

>>> $('#theme').qtip();
TypeError: f(this).data("qtip") is null { message="f(this).data("qtip") is null", more...}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文