我试图启用叠加模式。它在FireFox中工作得很好,但窗口对象在模态时位于遮罩后面。这阻止了与它的任何交互,而页面实际上是无用的。我已经尝试过调试一段时间,并且无法弄清楚。IE6-8中的jQuery工具模态叠加显示问题
这是在其网站上的例子的链接:http://flowplayer.org/tools/demos/overlay/modal-dialog.html
$.fn.cfwindow = function(btnEvent,modal,draggable){
//error checking
if(btnEvent == ""){
alert('Error in window :\n Please provide an id that instantiates the window. ');
}
if(!modal && !draggable){
$('#'+btnEvent+'[rel]').overlay();
$('#content_overlay').css('cursor','default');
}
if(!modal && draggable){
$('#'+btnEvent+'[rel]').overlay();
$('#content_overlay').css('cursor','move');
$('#custom').draggable();
}
if(modal){
$('#'+btnEvent+'[rel]').overlay({
// some mask tweaks suitable for modal dialogs
mask: {
color: '#646464',
loadSpeed: 200,
opacity: 0.6
},
closeOnClick: false
});
$('#content_overlay').css('cursor','default');
$('#custom').addClass('modal');
}
};
这就是我引用的时候我叫过:
<script type="text/javascript">
$(document).ready(function(){
$(document).pngFix();
var modal = <cfoutput>#attributes.modal#;
var drag = #attributes.draggable#;
var btn = '#attributes.selector#';
var src = '#attributes.source#';
var wid = '#attributes.width#';
$('##custom').width(parseInt(wid));
$('div##load_content').load(src);
$('##custom').cfwindow(btn,modal,drag,wid);
});
</script>
CSS的模式:
<style type="text/css">
.modal {
display:none;
text-align:left;
background-color:#FFFFFF;
-moz-border-radius:6px;
-webkit-border-radius:6px;
}
</style>
排除和额外的英镑标志,IE。 “##”。
问题的屏幕截图:http://twitpic.com/1tak06
注:IE6和IE8有同样的问题。
任何帮助,将不胜感激。
Update: HTML of the overlay/modal window:
<div class="simple_overlay" id="custom">
<div id="content_overlay">
<div id="handler">
<div id="headerss">
<h5 class="titless"><span style="color:##000000;">#attributes.title#</span></h5>
<div class="yellowRule"></div>
</div>
<div id="load_content">
</div>
</div>
</div>
</div>
更新:添加前端
<!-- overlay triggers. overlay is referenced in the 'rel' attribute -->
<p>
<button rel="#custom" type="button" id="openWindow">Email</button>
</p>
<cf_eo_window2
title="This modal isn't working in IE!"
selector="openWindow"
draggable="false"
width="350"
modal="true"
source="import-test.cfm"
/>
是的。我试着添加z-index。我现在将添加HTML。 – 2010-06-02 16:41:52
哇,这是很多divs。你的问题可能在于你的覆盖div内嵌入了你的模态div。模态脚本的美妙之处在于,它通常会忽略结构,只要它知道从哪里获取内容,IE就是表单和覆盖。试着拉出你的模态部分,看看你是否得到更好的结果。 – edl 2010-06-02 17:19:26
感谢您的输入。我试过了,没有任何影响。另外,每个div集在窗口的自定义设计中扮演着特定的角色。我尝试将其剥离到基础,但仍然没有。 – 2010-06-02 17:35:39