我认为这是一个 CSS 错误。我下载了 jqueryui 对话框示例代码,(显示在 jquery 网站上的广告)将其存储在记事本中并使用各种浏览器指向它,但样式错误。没有标题栏,也没有 X 按钮,但是标题文本确实出现了,并且出现了一个标有“关闭”的按钮。也没有周围的盒子。看起来文本和关闭按钮位于现有内容之上。是可拖动的,关闭按钮有效,所以功能正常。
这是从 jqueryui 站点获取的代码。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( "#dialog" ).dialog();
} );
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</body>
</html>
最佳答案
X 按钮在这里显示正常,如果您在本地使用 jquery ui,则必须添加图像文件夹
关于javascript - jqueryui 对话框缺少标题栏, "x button"和环绕对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46004004/