iframe jQuery的参考范围 [英] iframe jQuery scope of reference
问题描述
我的网站中有一个iframe,该iframe加载了jQuery页面.看来jQuery使用的是iframe尺寸作为参考,而不是我的实际文档. 例如,我使用一个iframe来引用此内容:
I have an iframe in my site and this iframe loads a page with jQuery. It seems that the jQuery is using the iframe dimensions as a reference instead of my actual document. For example, I used an iframe refering to this:
$.jGrowl(title + " has been used");
(jGrowl是一个基本上在页面右上方加载通知的插件)
(jGrowl is a plugin that basically loads a notice on the upper right of the page)
显示通知时,它显示在iframe的右上角,而不是实际的文档.无论如何,有没有让jQuery引用实际站点而不是iframe?
When the notice shows, it is showing on the upper right of the iframe and not the actual document. Is there anyway to get the jQuery to refer to the actual site and not the iframe?
推荐答案
document.parent将您指向正确的方向
document.parent points you to right direction
$(document.parent).jGlow(title + " has been used");
这篇关于iframe jQuery的参考范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!