我将swf嵌入到jquery ui模式对话框中,当我打开swf对话框时,当我关闭对话框并重新打开对话框而不刷新页面时,swf没有从第一个加载。 当我关闭并打开对话框时,我想从第一个重新打开swf
这是dialoge的代码:
$( "#quiz" ).dialog({
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
autoOpen: false,
resizable: false,
draggable: false,
modal: true,
width: 750,
height:350
});
$( "#quiz-link" ).click(function( event ) {
$( "#quiz" ).dialog( "open" );
event.preventDefault();
});
});
答案 0 :(得分:0)
每次打开/关闭对话框时,请尝试重建对话框的HTML。我认为你只是在展示&目前隐藏它,所以它永远不会重置。
尝试这样的事情:
$( "#quiz-link" ).click(function( event ) {
// create a clone of your dialog
var quiz_clone = $( "#quiz" ).clone().appendTo(body);
quiz_clone.dialog({
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
autoOpen: false,
resizable: false,
draggable: false,
modal: true,
width: 750,
height:350
});
// destroy the clone when it's closed
quiz_clone.on('close', function() {
quiz_clone.dialog( "destroy" ).remove();
});
// show the clone
quiz_clone.dialog( "open" );
event.preventDefault();
});
答案 1 :(得分:0)
$( “#测验”)。对话框({
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
autoOpen: false,
resizable: false,
draggable: false,
modal: true,
width: 750,
height:350,
close: function(){
$("#quiz").html(document.getElementById('quiz').innerHTML) ;
}
});
// Link to open the dialog
$( "#quiz-link" ).click(function( event ) {
$( "#quiz" ).dialog( "open" );
event.preventDefault();
});