This issue is driving me mad.
So I've got a modal dialog.
<div class="modal">
<img src="...."/>
</div>
Instanciated thus:
$(".modal").dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: false,
width: 530,
height: 460,
closeOnEscape: false,
dialogClass: 'popup noTitle'
});
Then I have a form:
<form>
<input type="submit"/>
</form>
and Js to open the modal:
$('form input').click(function() {
$(".modal").dialog('open');
});
In most browsers this works great:
In IE 9 and IE 10. The modal is opened but the image is missing:
I believe it is something to do with the form submit, stopping the image from loading. If I run $(".modal").dialog('open');
from the console it works fine. I've tried preloading the images:
$("#divSearching img").each(function() {
var imgObj = new Image();
imgObj.src = $(this).attr('src');
});
Doesn't help. Anyone else having issues with this or have a good solution? Everything I've tried has failed.
Tried to create a fiddle but because it is related to a form submit I couldn't do it.