Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/11/2016, 06:23
Juanjo87
 
Fecha de Ingreso: enero-2016
Mensajes: 19
Antigüedad: 8 años, 3 meses
Puntos: 0
como hago para agregar loading... a dialog JqueriUi

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,
            
draggablefalse,
            
modaltrue,
            
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.