我有第一页。哪里是一个链接,打开jQuery对话框与iframe与第二页在里面。在第二页中有一个可调整大小的文本区域。实际上,只有当我严格地打开第二个页面而不使用iframe时,textarea才能调整大小,但是它在iframe内部是不能调整大小的。怎么能修好呢?
UPD:这是我第一页的html代码:
<div id="dialog-system" title="system settings"><div class="loadingDivForDialog"><img src="Control/Image/loading.gif" alt="loading..." /></div><iframe id="SystemFrame" src="" scrolling="no" frameborder="0"></iframe></div>* This source code was highlighted with Source Code Highlighter.
这是“打开脚本”对话框:
function showSystemDialog(propertyName, id_prov, psysName, currentItemForTick) {$('.loadingDivForDialog').show();$('#SystemFrame').hide();var defaultSrc = "Settings.aspx?pro=" + propertyName + "&id_prov=" + id_prov;$("#systemFrame").attr('src', String(defaultSrc));$("#dialog-system").dialog({resizable: false,height: 300,width: 680,modal: true,position: 'center',buttons: {}});$('#SystemFrame').load(function() {$('.loadingDivForDialog').hide();$('#SystemFrame').show();$('#SystemFrame').contents().find("input[value='Update']").click(function() {var obj = $("#" + currentItemForTick);if (obj.get(0).tagName == "INPUT") {obj.attr('checked', true);}else {obj = window.parent.$("input[value='" + psysName + "']");obj.attr("checked", true);}});$('#SystemFrame').contents().find("input[value='Cancel']").click(function() { $("#dialog-system").dialog("close") });$("#dialog-system").dialog("option", "height", parseInt($('#SystemFrame').contents().height(), 10) + 35);});return false;}* This source code was highlighted with Source Code Highlighter.
这是第二页中的textarea和script:
<textarea name="ctl00$ContentPlaceHolderBody$ctrl02$fldText" rows="2" cols="20" id="ctl00_ContentPlaceHolderBody_ctrl02_fldText" class="textbox"></textarea><script type="text/javascript">$(function() {$("#ctl00$ContentPlaceHolderBody$ctrl02$fldText").resizable({handles: "se",maxWidth: 340,minWidth: 196,minHeight: 18});});</script>* This source code was highlighted with Source Code Highlighter.
有什么想法吗?
发布于 2012-05-24 14:10:22
当页面上有iframes时,我在调整大小方面也遇到了类似的问题。我开始得出这样的结论: iframe正在阻止相关的鼠标处理程序通过jQuery中的调整大小逻辑。
严格地说,这不是一个解决方案,但它可能会指向正确的方向。
更新:有关潜在修复jQuery http://bugs.jqueryui.com/ticket/3176的更多详细信息,请参阅此http://bugs.jqueryui.com/ticket/3176票证上的最后评论。
https://stackoverflow.com/questions/3158854
复制相似问题