ang*_*nng 3 jquery dialog jquery-ui modal-dialog
我的客户在加载内部页面时需要fadeIn/fadeOut图像.这是有问题的页面:http://angelynngrant.com/mei3/ouragency.html
问题:(1)淡入淡出不起作用; (2)fadeOut工作,但在'destroy'之前留下一个幻影矩形; (3)经常上载(和刷新时),模态出现在窗口角的左上角,然后"跳"到fadeOut.
我调整了我的CSS以使对话框的大多数元素消失和/或透明(例如.ui-dialog .ui-dialog-titlebar {visibility:hidden; background:transparent;}).
我在标题中有负载:
<script type="text/javascript">
$(window).load(function() {
$("#ModalSlide7").dialog({
width: 564,
height: 808,
modal: true
});
$(".ui-dialog-titlebar").hide();
});
</script>
Run Code Online (Sandbox Code Playgroud)
而我身体中剩下的模态:
<div id="ModalSlide7">
<img id="slide7" src="images/7.jpg" alt="Game of Authors vintage game">
<script type="text/javascript">
$('#slide7').fadeIn(3000, function() {
$('#slide7').fadeOut(3000).queue(function (next) {
$('#ModalSlide7').dialog('destroy').remove();
});
});
</script>
</div>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
(注意:网站设计/造型尚未完成.)
Dav*_*nce 13
$(function () {
// On document ready setup your dialog to define what happens
// when it gets shown and hidden and some basic settings
$("#dialog").dialog({
autoOpen: false,
draggable: false,
resizable: false,
show: {
effect: 'fade',
duration: 2000
},
hide: {
effect: 'fade',
duration: 2000
},
open: function(){
$(this).dialog('close');
},
close: function(){
$(this).dialog('destroy');
}
});
$(".ui-dialog-titlebar").remove();
// Finally open the dialog! The open function above will run once
// the dialog has opened. It runs the close function! After it has
// faded out the dialog is destroyed
$("#dialog").dialog("open");
});
Run Code Online (Sandbox Code Playgroud)
我认为您的混淆来自jquery ui对话框和一般jQuery函数提供的混合函数(例如,您正在使用fadeIn而不是在show调用函数时将对话框配置为淡入).这里列出了所有功能和大量示例!