我正在尝试使叠加层成为模态。它在 FireFox 中工作得非常好,但是当它变成模态时,窗口对象在掩码后面。这可以防止与它的任何交互,并且该页面实际上是无用的。我已经尝试调试了一段时间,但无法弄清楚。
这是他们网站上示例的链接: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"
/>