You can reveal a CSS div just after dialog.open()
and then have theloadServlet
HTML hide it again when it's loaded. Something like:
$dialog.dialog.open();
$("#loading").show()
I have this snippet of jquery code. I am trying to figure out a way to have a loading gif while this iframe loads. Thanks for any ideas.
var $dialog = $('<div></div>')
.html('<iframe style="border: 0px; " src="/servlet/trainingServlet?method=editDoc&dir=<%=legDir%>&ID=-1" width="100%" height="580"></iframe>')
.dialog({
autoOpen: false,
modal: true,
height: 575,
width: 680,
title: 'edit',
position: [200, 100],
buttons: {
Close: function() {
$( this ).dialog( "close" );
}
}
});
$dialog.dialog('open');
var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" width="780" height="580" allowfullscreen></iframe>'); iframe.attr("src", "/user/list");
var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({ autoOpen: false, modal: true, resizable: false, width: "auto", height: "auto", close: function () { iframe.attr("src", ""); } }); $(".thumb a").on("click", function (e) { e.preventDefault(); var src = $(this).attr("href"); var title = $(this).attr("data-title"); var width = $(this).attr("data-width"); var height = $(this).attr("data-height"); iframe.attr({ width: +width, height: +height, src: src }); dialog.dialog("option", "title", title).dialog("open"); });
You can reveal a CSS div just after
| |||||||||||||
|