javascript - embed swf in jquery ui modal dialog -
i'm embed swf jquery ui modal dialog, when open dialog swf played, , when close dialog, , reopen dialog without refresh page, swf did not loaded first. want swf reopened first when close , open dialog
this code of 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(); }); });
try rebuilding html of dialog each time open/close it. think you're showing & hiding currently, never resets.
try out instead:
$( "#quiz-link" ).click(function( event ) { // create clone of 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 clone when it's closed quiz_clone.on('close', function() { quiz_clone.dialog( "destroy" ).remove(); }); // show clone quiz_clone.dialog( "open" ); event.preventdefault(); });
Comments
Post a Comment