从jQuery iframe模式对话框“从url加载”中删除或隐藏菜单
如何从url的弹出模式对话框中删除/隐藏菜单标题从jQuery iframe模式对话框“从url加载”中删除或隐藏菜单,jquery,asp.net,c#-4.0,Jquery,Asp.net,C# 4.0,如何从url的弹出模式对话框中删除/隐藏菜单标题 var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" allowfullscreen id="frameIdcustomer"></iframe>'); var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({
var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" allowfullscreen id="frameIdcustomer"></iframe>');
var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({
autoOpen: false,
modal: true,
resizable: false,
width: "auto",
height: "auto",
close: function () {
iframe.attr("src", "");
}
});
$("#btn_newCustomer").on("click", function AddCust(e) {
e.preventDefault();
var src = "../MasterPages/CustomerMaster.aspx";
var title = "Customer Master";
var width = "980";
var height = "530";
iframe.attr({
width: +width,
height: +height,
src: src
});
dialog.dialog("option", "title", title).dialog("open");
$("#frameIdcustomer").contents().find("#menuheaderr").hide();
});
var-iframe=$('');
var dialog=$(“”).append(iframe.appendTo(“正文”).dialog({
自动打开:错误,
莫代尔:是的,
可调整大小:false,
宽度:“自动”,
高度:“自动”,
关闭:函数(){
iframe.attr(“src”,即“);
}
});
$(“#btn_newCustomer”)。在(“单击”,函数AddCust(e){
e、 预防默认值();
var src=“../MasterPages/CustomerMaster.aspx”;
var title=“客户主机”;
var width=“980”;
var height=“530”;
iframe.attr({
宽度:+宽度,
身高:+身高,
src:src
});
对话框(“选项”、“标题”、“标题”)。对话框(“打开”);
$(“#frameIdcustomer”).contents().find(“#menuheader”).hide();
});
我尝试了$(“menuheader”).hide()
,但它不起作用
$(“#frameIdcustomer”).contents().find(“#menuheader”).hide()代码>也不起作用。当您调用该行以隐藏标题时,iFrame可能仍在加载。尝试将该行放在回调函数中
var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({
autoOpen: false,
...
complete: function() { $("#frameIdcustomer").contents().find("#menuheaderr").hide(); }
});
var dialog=$(“”).append(iframe).appendTo(“body”).dialog({
自动打开:错误,
...
完成:函数(){$(“#frameIdcustomer”).contents().find(“#menuheader”).hide()}
});
试试这个:
var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" allowfullscreen id="frameIdcustomer" onload="hideMenu()"></iframe>');
function hideMenu(){
$("#frameIdcustomer").contents().find("#menuheaderr").hide();
}
var-iframe=$('');
函数hideMenu(){
$(“#frameIdcustomer”).contents().find(“#menuheader”).hide();
}
要查找元素,需要等待iframe内容加载。如果键入$(“#frameIdcustomer”).contents().find(“#menuheader”).hide();在您的开发人员控制台中,它被打开后是否工作?是的,它在打开后工作我调试,如果我编写相同的代码,那么在显示窗口之前如何做?我尝试了完成:function(){alert(hi”);}不工作?我在我的aspx页面中使用更新面板