So... I have a site here...
The jQuery dialog is sending an ajax request to here.
There's an auto-popup when you arrive on the page. Please Dismiss that one.
When you click on this image...

which is associated with this function call...
$(function() {
$("#compliance").dialog({
autoOpen: true,
modal: true,
width: 750,
height: 'auto',
show: 'fade',
hide: 'fade',
position: {my: "center top", at:"center top", of: window },
buttons: {
"Dismiss": function() {
$(this).dialog("close");
}
}
});
$(".dialogify").on("click", function(e) {
e.preventDefault();
$("#compliance").html("");
$("#compliance").dialog("option", "title", "Loading...").dialog("open");
$("#compliance").load(this.href, function() {
$(this).dialog("option", "title", $(this).find("h1").text());
$(this).find("h1").remove();
});
});
});
Or this one...

which is associated with this function...
$(function() {
$("#switch").dialog({
autoOpen: false,
modal: true,
width: 750,
height: 'auto',
show: 'fade',
hide: 'fade',
position: {my: "center top", at:"center top", of: window },
buttons: {
"Dismiss": function() {
$(this).dialog("close");
}
}
});
$(".dialogify").on("click", function(e) {
e.preventDefault();
$("#switch").html("");
$("#switch").dialog("option", "title", "Loading...").dialog("open");
$("#switch").load(this.href, function() {
$(this).dialog("option", "title", $(this).find("h1").text());
$(this).find("h1").remove();
});
});
});
...a modal comes up. But it appears that two modals come up. The opaque background is darker than it should be. And, when you dismiss the first one, there's another one, as the background gets lighter.
Why is this? I only have one function call for each.