我试图居中jquery对话框的问题。运行这段代码时,对话框出现在浏览器窗口的左上角。我也尝试使用onclick javascript事件执行代码,所以没有“加载”问题。我看了一些关于同一个问题的“计算器”的问题,但他们都没有为我工作。jquery对话框不居中
出了什么问题?一定是一件简单的事情。
谢谢
<!DOCTYPE HTML>
<html>
<head>
<!--My jQuery library code location -->
<script src="/jQuery/jquery-1.7.2.js"></script>
<script src="/jQuery/js/jquery.ui.widget.js"></script>
<script src="/jQuery/js/jquery.ui.dialog.js"></script>
<script src="/jQuery/js/jquery.ui.core.js"></script>
<script src="/jQuery/js/jquery.ui.mouse.js"></script>
<script src="/jQuery/js/jquery.ui.draggable.js"></script>
<script src="/jQuery/js/jquery.ui.resizable.js"></script>
<link rel="stylesheet" href="/jQuery/css/base/jquery.ui.all.css">
<script type="text/javascript" >
$(document).ready(function(){
$("#span-msg").empty().append("Message");
$("#div-err-msg").dialog({
modal: true,
title: "Testing",
position: "centre"
});
});
</script>
<body>
<div id="div-err-msg" style="display:none;">
<span id="span-msg"></span>
</div>
</body>
</head>
</html>
你应该能够复制并粘贴上面的代码复制,只是点了jQuery SRC在您的环境中正确的位置
仅供参考,您的交易''标签是放错了地方。它应该在'
' – asprin