Pues tengo el siguiente código de jqueryUi para cargar un iframe en una ventana modal
Código PHP:
<script>
$(function(){
$('ul.capitulos li a').on('click', function(e){
e.preventDefault();
$('<div/>', {'class':'myDlgClass', 'id':'link-'+($(this).index()+1)})
.html($('<iframe/>', {
'src' : $(this).attr('href'),
'style' :'width:100%; height:100%; border:none;'
})).appendTo('body')
.dialog({
title : $(this).text(),
width : 800,
height :380,
draggable: false,
modal: true,
buttons: {
"cerrar": function() {
$(this).remove();
$(".myDlgClass").empty();
}
},
open: function() {
$('.ui-widget-overlay').addClass('custom-overlay');
$('.myDlgClass').css('overflow', 'hidden');
$('.ui-widget-overlay').on('click',function(){
$(".myDlgClass, .ui-dialog").remove();
});
},
close: function() {
$(".myDlgClass, .ui-dialog").remove();
},
});
});
});
</script>
Como hago para agregarle un loading...cuando se abra el dialog y que desaparezca cuando cargue el iframe?
He intentado varias formas y no soy capaz. Soy capaz que aparezca cuando se abre el dialog pero no desaparece al terminar de cargar el iframe, es más no le da paso al iframe, se me queda en el loading.... y de hay no pasa.