I would like to display loading.gif when clicking jquery ui dialog with iframe until page is loaded inside iframe. Does anybody knows something about this issue? Is it possible? Here is my code:
$('.dialog').click(function(e) {
e.preventDefault();
var $this = $(this);
var horizontalPadding = 30;
var verticalPadding = 30;
$('<iframe id="externalSite" class="externalSite" src="' + this.href + '" />').dialog({
title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
autoOpen: true,
width: 800,
height: 500,
modal: true,
buttons: {
"Zatvori": function() {
$(this).dialog("close");
}
},
resizable: true,
autoResize: true,
overlay: {
opacity: 0.5,
background: "black"
},
close: function(event, ui) {
$(function() {
var theVal = $.cookies.get('updatedForm');
if (theVal != null) {
$.cookies.del('updatedForm');
location.reload(true);
}
});
}
}).width(800 - horizontalPadding).height(500 - verticalPadding);