jQuery qTip IE 调整大小问题
我正在使用 qTip (jquery.qtip-1.0.0-rc3.min) 和 jQuery (jquery -1.3.2)。
当在 IE 中使用 qTip 和非动态加载内容时,qTip 工作正常。但是,当通过 ajax 调用加载内容时,一旦加载内容,qTip 内容就不会调整大小。我尝试在各种回调上添加 updateWidth ,但没有任何运气。事实上,当使用 updateWidth 时,我在 qTip 内容的左上角看到一个小白框。相同的代码在 Safari、Firefox 和 Opera 中运行良好。
IE 在使用 ajax 调用时阻止内容调整大小是怎么回事?
$(document).ready(function() {
$('ul.person_info li:first-child').each(function() {
$(this).qtip({
show: 'mouseover',
hide: 'mouseout',
style: {
name: 'cream'
},
content: {
url: '<%= Url.Action("FindPerson", "People") %>',
data: { id: $(this).attr('id') },
method: 'get'
}
});
});
$('ul.person_info li:first-child').qtip({
api: {
onContentUpdate: function() { this.updateWidth(); },
onContentLoad: function() { this.updateWidth(); },
beforeContentLoad: function() { this.updateWidth(); }
}
});
});
I am using qTip (jquery.qtip-1.0.0-rc3.min) and jQuery (jquery-1.3.2).
When using qTip in IE with non-dynamically loaded content qTip works fine. However, when loading content via an ajax call the qTip content does not resize once content is loaded. I have tried adding an updateWidth on the various callbacks without any luck. In fact, when utilizing updateWidth I get a small white box at the top left corner of the qTip content. This same code works fine in Safari, Firefox, and Opera.
What's going on with IE that is keeping the content from resizing when using an ajax call?
$(document).ready(function() {
$('ul.person_info li:first-child').each(function() {
$(this).qtip({
show: 'mouseover',
hide: 'mouseout',
style: {
name: 'cream'
},
content: {
url: '<%= Url.Action("FindPerson", "People") %>',
data: { id: $(this).attr('id') },
method: 'get'
}
});
});
$('ul.person_info li:first-child').qtip({
api: {
onContentUpdate: function() { this.updateWidth(); },
onContentLoad: function() { this.updateWidth(); },
beforeContentLoad: function() { this.updateWidth(); }
}
});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 qTip 论坛上请求帮助 Dustin Moore、Craig Thomson 和我发现了 qTip 插件的问题。该问题已由 Dustin 的 qTip 分支解决。该分支后来被拉入 qTip 主分支,并可在 存档中找到qTip 版本。
值得注意的是,qTip 已经发展并转移到 qTip2 并且此问题、答案和修复为中心qTip 1.0 左右。
After requesting help on the qTip forums Dustin Moore, Craig Thomson and I were able to identify an issue with the qTip plugin. The issue was resolved by a fork of qTip by Dustin. This fork was later pulled into the main qTip branch and is available in the archived versions of qTip.
It is important to note that qTip has evolved and moved onto qTip2 and that this question, answer and fix centered around qTip 1.0.