Ich kann nicht herausfinden, warum ein einfaches Jquery-Dialogfeld mit der Option "x" nicht angezeigt wird. Stattdessen wird in der Titelleiste ein Symbol zum Minimieren angezeigt.
Ich verwende dies als Referenz: http://api.jqueryui.com/dialog/#option-modal
Hier ist ein Screenshot:
mein html:
<div id="sibebar-dialog" title="Info">
<p></p>
</div>
Mein Javascript:
function showDialog(text) {
if (text == undefined || text == null) {
text = "Info";
}
$("#sibebar-dialog").text(text);
$("#sibebar-dialog").dialog({
modal: true,
resizable: false,
show: { effect: "blind", duration: 200 },
buttons: {
"OK!": function () {
$(this).dialog("close");
}
}
});
}
Vielleicht stört hier etwas in meinen CSS-Einstellungen?
Vielen Dank,
Bob
Antworten:
0 für die Antwort № 1Ich hatte die gleiche Erfahrung. Es wurde gelöst, als ich die notwendige Bibliothek hinzufügte:
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js" integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E=" crossorigin="anonymous"></script><link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"><link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
Es sollte für dich funktionieren.