日期:2013-11-27 浏览次数:20893 次
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
//代码段一
<style type="text/css"><!--
#floater {position: absolute;left: 500;top: 146;width: 125;visibility: visible;z-index: 10;}
-->
</style>
//代码段一结束
<title>浮动层</title>
</head>
//代码段二(第一层内容,目前为空)
<body bgcolor="#FFFFFF">
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
//代码段二结束
//代码段三(浮动层内容,目前为一简单表格)
<div ID="floater" style="left: 0px; top: 1px">
<table border="1" cellpadding="0" cellspacing="0"
bgcolor="#25A78D" bordercolordark="#00FFFF"
bordercolorlight="#000000">
<tr>
<td>111<a href="file:///G:/C/NEW/dhtml2.htm">1111</a></td>
<td>2222222</td>
</tr>
</table>
</div>
//代码段三结束
//代码段四
<script LANGUAGE="JavaScript">
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent; }
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.left += percent;
lastScrollX = lastScrollX + percent;}}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocus(x,y) {
stalkerx = document.floater.pageX;
stalkery = document.floater.pageY;
stalkerwidth = document.floater.clip.width;
stalkerheight = document.floater.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false; }
function grabIt(e) {
if(IE) {whichIt =