安博士首页div悬浮代码

[ 2005-11-23 23:44:53 | 作者: Admin ] 字号: | |
<style type="text/css">
<!--
body {
  margin-left: 0px;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px;
}
-->
</style>
<!--
.style8 {color: #21719C; font-size: 13px; }
.style12 {color: #000000; font-size: 12px;}
-->
</style>
<style>
div {
  position:absolute;
  font-size:8px;
  font-family:Tahoma;
  z-index:2;
  text-align:center;
  width: 325px;
  height: 215px;
}
button {font-size:14px; font-family:Tahoma; background:gray; border:0 solid #333333; color:white; font-weight:normal; width:22;}
.style1 {font-size: 12px}
</style>
<script>

 // Windows In JavaScript (Test Ver.)
 // This source is created by Zective (http://zective.com)
 // Div ??? Table ?? ??? JavaScript ? ???? ??? ?? ???? ???? ?? ????

 D_curX = D_curY = 0;
 D_now = null;
 D_prev = null;
 D_1stmv = 1;
 lrs = null;
 dtm = null;
 stm = null;

 document.onmouseup = FinishDrag;

 function FinishDrag() {
 if(document.onmousemove == OnDragMove) {
 if(D_now.style.pixelLeft < 0) D_now.style.pixelLeft = 1;
 if(D_now.style.pixelTop < 0) D_now.style.pixelTop = 1;
 
 /*
 l = document.body.clientWidth - D_now.style.pixelWidth;
 l = document.body.clientHeight-D_now.style.pixelHeight;
 */

 }

 if(document.onmousemove == OnResizeMove) lrs.Finish();
 document.onmousemove = null;
 D_now = null;
 }

 function BeginDragging(lyr) {
 D_now = lyr;
 D_1stmv = 1;
 document.onmousemove = OnDragMove;
 }

 function OnDragMove() {
 if(D_now == null) return true;
 if(D_1stmv) {
 D_curX = event.clientX;
 D_curY = event.clientY;
 D_1stmv = 0;
 if(D_prev != D_now) D_now.style.zIndex = D_now.style.zIndex + 1;
 D_prev = D_now;
 return false;
 }
 D_now.style.pixelLeft += (event.clientX - D_curX);
 D_now.style.pixelTop += (event.clientY - D_curY);
 D_curX = event.clientX;
 D_curY = event.clientY;
 event.returnValue = false;
 }

 function diOnMouseDown(i) {
 if(event.button == 1) BeginDragging(i);
 event.returnValue = false;
 }

 function OnResizeMove() {
 if(D_1stmv) {
 D_curX = event.clientX;
 D_curY = event.clientY;
 D_1stmv = 0;
 return false;
 }
 lrs.AddSize(event.clientX - D_curX, event.clientY - D_curY);
 D_curX = event.clientX;
 D_curY = event.clientY;
 event.returnValue = false;
 }

 function resize1(_child, _ream, _tream, _wmax, _hmax) {

 var tream, wlream, hlream, wmax, hmax;

 tream = _ream + 1;
 wlream = _ream + 1;
 hlream = _ream - 4;

 wmax = _wmax - wlream;
 hmax = _hmax - hlream;

 cele = eval("document.all."+_child+".style");
 cele1 = parseInt(cele.width);
 cele2 = parseInt(cele.height);

 hidele = eval("document.all."+_child+"c.style");
 hidele.display = 'block';

 if(cele1 < _wmax) {
 cele.width = cele1 + _ream;
 play1 = setInterval("resize1('"+_child+"',"+_ream+","+_tream+","+_wmax+","+_hmax+")" , 0);
 } else if(cele2 < _hmax) {
 cele.height = cele2 + _ream;
 play1 = setInterval("resize1('"+_child+"',"+_ream+","+_tream+","+_wmax+","+_hmax+")" , 0);
 } else if(cele1 >= wmax && cele2 >= hmax) {
 clearInterval();
 } else {
 cele.width = cele1;
 cele.height = cele2;
 clearInterval(play1);
 }
 }

 function resize2(_child, _ream, _tream, _wmin, _hmin) {

 var tream;

 tream = _ream + 1;

 cele = eval("document.all."+_child+".style");
 cele1 = parseInt(cele.width);
 cele2 = parseInt(cele.height);

 hidele = eval("document.all."+_child+"c.style");

 if(cele2 > _hmin) {
 cele.height = cele2 - _ream;
 play2 = setInterval("resize2('"+_child+"',"+_ream+","+_tream+","+_wmin+","+_hmin+")" , 0);
 } else if(cele1 > _wmin) {
 cele.width = cele1 - _ream;
 play2 = setInterval("resize2('"+_child+"',"+_ream+","+_tream+","+_wmin+","+_hmin+")" , 0);
 } else if(cele1 <= _wmin && cele2 <= _hmin) {
 clearInterval();
 hidele.display = 'none';
 } else {
 cele.width = cele1;
 cele.height = cele2;
 clearInterval(play2);
 }
 }

 function DoExit(_obj, _order) {
 dele = eval("document.all."+_obj+".style");
 if(_order == 0) {
 dele.display = 'block';
 } else {
 dele.display = 'none';
 }
 }

</script>
<div id="parent2" style="text-align:right; left:-6px; top:36px; z-index:0;" oncontextmenu="return false;">
 <table id="child2" onmousedown="diOnMouseDown(parent2)" cellspacing="0" cellpadding="0" border="0" style="border:1 solid black; width:162px; height:19px; left:0; top:0; background:#CCCCCC; cursor:move;">
 <tr height="21">
 <td align="left" valign="middle" class="style12" style="font size:12px 宋体; font-size: 12px;">办事处设立公告</td>
 <td align="right" valign="MIDDLE">
 <button onclick="DoExit('parent2', 1);" style="height:21; vertical-align:MIDDLE;"><img src="http://www.ahn.com.cn/images/new_main/3.gif" width="12" height="10"></button></td>
 </tr>
 <tr height="1" bgcolor="black">
 <td colspan="2"></td>
 </tr>
 <tr id="child1c" style="background:white;" valign="top">
 <td colspan="2" style="font size:11px Tahamo;"><table width="162" height="190" border="0" align="left" cellpadding="0" cellspacing="0">
 <tr>
 <td width="217" height="190" style="font size:12px ; color:black;"><a href="http://auth70.ahn.com.cn/company/map.jsp" target="_blank"><img src="/images/main/huazhongnewoffice.gif" width="322" height="190" border="0" onFocus="this.blur()"></a></td>
 </tr>
 </table></td>
 </tr>
 </table>
</div>
Share
评论Feed 评论Feed: http://www.85815.com/feed.asp?q=comment&id=954
UTF-8 Encoding 引用链接: http://www.85815.com/trackback.asp?id=954&key=
这篇日志没有评论.
发表
表情图标
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
UBB代码
转换链接
表情图标
悄悄话
用户名:   密码:   注册?
验证码 * 请输入验证码