6
我有简单的HTML页面:如何打开JQuery用户界面弹出的onclick
<html>
<head>
<title></title>
</head>
<body>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#OpenDialog").click(function() {
$("#dialog").dialog({modal: true, height: 590, width: 1005 });
});
});
</script>
<a id="#OpenDialog" href="#">Click here to open dialog</a>
<div id="dialog" title="Dialog Title">
<p>test</p>
</div>
</body>
</html>
我需要有弹出内容隐藏,当点击链接打开一个对话框。
我在代码中出错了吗?
谢谢!
否决权的理由? – Adil 2012-08-10 17:18:30
没有很好的理由来降低这一个,Adil是正确的。只有在从选择器(如jQuery或CSS)引用它时,才能将#置于实际标记的id中。在这种情况下,click处理程序永远不会分配给元素“OpenDialog”,因为它实际上不存在。 – mclark1129 2012-08-10 17:20:48