我想从链接iframe打开一个对话框,但是我不能使它弹出一个对话框有人知道原因吗?
我有一个iFrame在html<iframe src="Add_Reviewer.html" width="100%" name="test" frameborder="0" scrolling="auto" height="100%"></iframe>
add_review .html中的链接<a href="#" id="advance_add">Advance Add</a>
jQuery代码
var $advance_add = $('<div></div>')
.html('<iframe src="Advance_Add.html" width="100%" name="test" frameborder="0" scrolling="auto" height="100%">')
.dialog({
autoOpen: false,
bgiframe: true,
width:650,
minWidth: 650,
height: 550,
closeOnEscape:true,
modal:true,
title: 'Addvance Add',
buttons : {
"Close" : function() {
$(this).dialog("close");
}
}
});
$("#advance_add").click(function(e) {
e.preventDefault();
$advance_add.dialog('open');
});
我使用以下代码:
$("#advance_add").click(function() {
$('<iframe src="Advance_Add.html" frameborder="0" />').dialog({
modal: true,
dialogClass: 'priceBox',
title: 'Your title',
height: 400,
width: 500,
draggable: false,
resizable: false});
});