<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>对话框</title>
<script language="javascript" type="text/javascript" src="./js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery-ui-1.8.18.custom.min.js"></script>
<link rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.18.custom.css" />
<script type="text/javascript">
$(function (){
$("#dialog").dialog({
autoOpen:false,
show:"blind",
hide:"explode"
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");// open参数 作用 打开对话框
});
});
</script>
</head>
<body>
<a href="#" id="dialog_link"><span>弹出对话框</span></a>
<div id="dialog" title="我的好友">
你好,请问能问你个问题吗??
</div>
</body>
</html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>对话框</title>
<script language="javascript" type="text/javascript" src="./js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery-ui-1.8.18.custom.min.js"></script>
<link rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.18.custom.css" />
<script type="text/javascript">
$(function (){
$("#dialog").dialog({
autoOpen:false,
show:"blind",
hide:"explode"
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");// open参数 作用 打开对话框
});
});
</script>
</head>
<body>
<a href="#" id="dialog_link"><span>弹出对话框</span></a>
<div id="dialog" title="我的好友">
你好,请问能问你个问题吗??
</div>
</body>
</html>

本文介绍了一种利用jQuery UI库创建可自定义显示效果的对话框的方法。通过简单的HTML结构和jQuery UI提供的API,实现了对话框的弹出功能,并允许用户通过点击链接来触发对话框的打开与关闭。
91

被折叠的 条评论
为什么被折叠?



