iframe呼叫父頁面的方法
來源:文萃谷 1.71W
貴有恆何必三更眠五更起,最無益只怕一日曝十日寒。 以下是小編為大家搜尋整理的'iframe呼叫父頁面的方法,希望能給大家帶來幫助!更多精彩內容請及時關注我們應屆畢業生考試網!
1
x(); //xxxxx()代表父頁面方法 |
具體列子如下,其中包括easyUI的右鍵和單擊事件
body部分程式碼
1234567891011121314151617181920212223 | < body class = "easyui-layout" > <!-- 左側目錄 --> < div data-options = "region:'west',split:true,title:'主題',iconCls:'icon-arrowIn'" style = "width: 270px; background: #efefef" > <!-- 目錄數 --> < ul id = "tree" class = "easyui-tree" ></ ul > </ div > < input type = "hidden" value = "${ }" id = "themeType" /> <!-- 右側窗體 --> < div data-options = "region:'center',title:'內容顯示',iconCls:'icon-arrowOut'" style = "overflow: hidden" > < iframe name = "leftIframe" id = "leftIframe" src = "" frameborder = "0" height = "100%" width = "100%" ></ iframe > </ div > <!-- 右鍵選單 --> < div id = rightCliMean class = "easyui-menu" style = "width:120px;" > < div onclick = "updateTheme();" data-options = "iconCls:'icon-edit'" >修改</ div > < div onclick = "removeObjectNode();" data-options = "iconCls:'icon-tip'" >刪除</ div > </ div > < script type = "text/javascript" > loadTree(); </ script > </ body > |
js部分:
?
1234567891011121314151617181920212223242526272829303132333435363738394041 | function loadTree() { $( '#tree' )( { url : 'on, animate : true, lines : true, onContextMenu : function(e, node) { entDefault(); $(this)(' select ', et); /** * 不可以對根節點(預設主題)進行操作 */ var parent = $(this)(' getParent ',et); if(parent){ if( == ' 預設主題 '){ $t("提示資訊","預設主題不能進行操作!","warning"); return false; } $(' #rightCliMean')('show',{ left: X, top: Y }); } }, onClick: function (node) { //單機事件 var type = ; if ( "Schema" == type){ var themeType = $( "#themeType" )(); $(' #leftIframe')('src', 'on'); return ; } } }); }
/** * 重新整理左側主題 */ $( function (){ Tree(); }) |