我有第一页。在哪里打开带有 iframe 的 jQuery 对话框的链接,里面有第二页。第二页内有一个可调整大小的文本区域。实际上,仅当我在没有 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 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.
UPD:有什么想法吗?