我似乎找不到使用父技巧在iframe顶部显示jquery ui对话框的正确解决方案。
这是我的实际样本: http://jsfiddle.net/NZ3eH/2/
PARENT:
div正在父页面上加载iframe
<div>
<iframe src="http://labs.**/jquery/dialog.html" width="400" height="300" frameborder="0" scrolling="no" id="iframe"></iframe>
</div>
IFRAME
对话框上的JS
<script>
$(function() {
$( "#create" ).parent().click(function() {
$( "#dialog-modal" ).dialog( "open" );
});
$( "#dialog-modal" ).dialog({
autoOpen: false,
height: 140,
modal: true
});
});
</script>
所有JS都在iframe中。
是否可以让对话框显示在iframe之上?它似乎锁定在它上面。
答案 0 :(得分:2)
尝试使用以下代码
$( "#create" ).click(function() {
parent.$( "#dialog-modal" ).dialog( "open" );
});
parent.$( "#dialog-modal" ).dialog({
autoOpen: false,
height: 140,
modal: true
});