<!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>
<!-- 请注意,别忘了引入jquery.js-->
<script src="js/jquery.js"></script>
<script type="text/javascript">
function showdiv(){
var str = "这里边是定义的浮动层的显示内容,实际应用中应该是从数据库动态读取的内容</br>能接受html标签,但要将双引号转为单引号这里边是定义的浮动层的显示内容,实际应用中应该是从数据库动态读取的内容</br>能接受html标签,但要将双引号转为单引号使用这里边是定义的浮动层的显示内容,实际应用中应该是从数据库动态读取的内容</br>能接受html标签号使用使用";
$("#p1").html(str);
var wid = $(window).width();
var hei = $(window).height();
var lef = (wid - 400)/2+"px";
var heii = (hei - 200)/2+"px";
$("#dialog").css({
"z-index":"5",
"position":"absolute",
"display":"block",
"width":"500px",
"height":"400px",
"left":lef,
"top":heii,
"background":"#eeeeee",
"color":"blue",
"border":"1px solid red"
});
}
function closedive(){
$("#dialog").slideup("1000");
</script>
</head>
<body>
<div id="div1" onclick="showdiv()" style="width:70px; height:20px; background-color:#ff9933">
&nbsp;&nbsp;&nbsp;点击</div>
<div id="dialog" style="display:none;padding:8px;">
<div id='close' style="text-align:right; padding-right:40px;" onclick="closedive()">关闭</div>
<div id="p1"></div>
</div>
</body>
</html>