jQuery qTip &厚盒
我在 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
- ThickBox,http://jquery.com/demo/thickbox/ *(我知道它是已弃用)
- qTip,http://craigsworks.com/projects/qtip/
- AjaxForms,http://jquery.malsup.com/form/
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
- ThickBox, http://jquery.com/demo/thickbox/ *(I am aware it's deprecated)
- qTip, http://craigsworks.com/projects/qtip/
- AjaxForms, http://jquery.malsup.com/form/
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论