1
我有第一頁。在哪裏是一個鏈接,打開jQuery對話與iframe與第二頁內。 第二頁內有可調整大小的textarea。 其實textarea只有當我打開第二頁時嚴格無iframe才能調整大小,但它在iframe中不能調整大小。 如何解決?在iframe中可調整大小的jQuery問題
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 .
這是腳本opent對話框:
- 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的和腳本從第二頁碼:
- <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:任何想法?
它看起來像可調整大小的插件無法計算高度和元素的寬度的更多細節。 – 2010-07-01 14:45:36
你能發佈一些示例代碼嗎?有(可惜)很多事情可能會錯誤的iframe和jQuery。 – HurnsMobile 2010-07-01 15:18:26
我已經添加了代碼。哪些事情可能會出錯? – 2010-07-01 15:49:49