当前位置:编程学习 > JAVA >>

求JAVA高手帮我解说下下面的代码

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Ajax提示框效果</title>
<style type="text/css">
a{ color:#000; font-size:12px;text-decoration:none}
a:hover{ color:#900; text-decoration:underline}
body{background:;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#003366); overflow:hidden}
#massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}
#mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth);height:expression(body.scrollHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}
.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
</style>
<!--实现层移动-->
<script language="javascript">
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove
function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MMove(){
if(Obj!=''){
  document.all(Obj).style.left=event.x-pX;
  document.all(Obj).style.top=event.y-pY;
  }
}

function MUp(){
if(Obj!=''){
  document.all(Obj).releaseCapture();
  Obj='';
  }
}
</script>
</head><body>
<div id="massage_box"><div class="massage">
<div class="header" onmousedown=MDown(massage_box)><div style="display:inline; width:150px; position:absolute">弹出效果</div>
<span onClick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'" style="float:right; display:inline; cursor:hand">×</span></div>
<ul style="margin-right:25"><li>
<a href="/">测试</a>测试
</li><li>测试</li></ul></div></div>
<div id="mask"></div>
<span onClick="mask.style.visibility='visible';massage_box.style.visibility='visible'" style="cursor:hand"><a href="#">点此提示</a></span>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>

追问:好的,非常感谢你的回答。。。请问一下我这个程序能够完成“采用Ajax技术编写一个弹出对话框的网络应用程序。”这个题目吗。。。如果不行的话还需要添加什么内容???麻烦帮我补充一下。。。还有要说明这个程序开发的基础、开发思路、关键技术等内容,很麻烦你了,表示感谢,我一定会再多加很多积分的
答案:
这不是java这是html使用css网页样式和javascript网页脚本来实现网页动态效果特效的。这段代码是用来在网页中仿windows窗口的,这里主要是先在html页面中添加div层模块,用于作为弹出的小窗口的框架,利用css对这个div层进行样式处理,达到一种类似于windows窗口的样式,而上面的javascript的作用则是利用鼠标按下时让div层随着鼠标移动,鼠标松开的时候停止移动来模仿一种窗口拖动的效果。而窗体中的内容则是直接可以在div层里面添加你想要的任何html元素。他这里是添加了三个测试文字,第一个测试文字是一个超链接,第二个则是普通的文本,第三个也仅仅是嵌套在li元素下的普通文本,具体效果你可以把这段代码复制到文本文件中另存为html后缀例如:新建文本文件.html   运行之后就可以看到效果了。这个网页特效很简单 ,但是看起来挺好看的,希望采纳

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效|Linkweb.cn/Js|---很恶心的常见整人效果</title>
</head>

<body>

<a href=>

alert('我不是说过不可以这样吗?');

alert('你把我的话当什么了?');

alert('你知道错了吗?');

alert('什么?你居然....');

alert('居然还没意识到自己做错了?');

alert('那好,你要为此付出代价!');

alert('我要你在这里点足一千下......');

alert('什么?你开始有点后悔了?');

alert('何必呢?');

alert('你当初干什么去了?');

alert('不原谅你!');

alert('好从现在开始再点995下......');

alert('你的手开始累了吗?');

alert('什么?你已经没力气了?');

alert('你一直在求我原谅你啊!');

alert('看来你是真的知道错了!');

alert('下次你还会这么做吗?');

alert('真的不会了?');

alert('那好,今天就放你一马!');

alert('写封信给我说声对不起!');

alert('你能这么做我很高兴!!!');

document.bgColor='black';

document.fgColor='White';

window.location.href=>


嘻试吧爽噢。。


</body>

</html>

当你按下鼠标时, div会上移一点. 或者下移一点.

上一个:JAVA存取款的数值不准确,要如何改进?
下一个:Java IDE:Eclipse中文语言包使用方法

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,