js浮动层制作

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
    
<script language="JavaScript1.2">
function MM_findObj(n, d) {
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }

  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n);
  return window.hintDiv;
}

function MM_setTextOfLayer(objName,x,newText) {
  newText = "<TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR=/"#456972/"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN = /"CENTER/" BGCOLOR=/"#FFFFFF/"><FONT FACE=/"宋体/" COLOR=/"#8A2BE2/">"+newText+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {
      document.write(unescape(newText));
      document.close();
    }
    else innerHTML = unescape(newText);
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
 if ((obj=MM_findObj(args[i]))!=null)
 {
  v=args[i+2];
  if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
  obj.visibility=v;
 }
}


function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

//-->

</script>


</HEAD>

<BODY>
<DIV id=hintDiv style="POSITION: absolute; Z-INDEX: 0; left: 0px; top: 17px; width: 500px; height: 100px;visibility: hidden;" ></DIV>
<table border=1 width =500 height=400>
  <TR onMouseOver=" MM_setTextOfLayer('overDiv','','测试');MM_showHideLayers('overDiv','','show');
    MM_changeProp('overDiv','','style.left',window.event.x+document.body.scrollLeft,'DIV');
 MM_changeProp('overDiv','','style.top',window.event.y+document.body.scrollTop,'DIV');
    MM_changeProp('overDiv','','style.width',5*13,'DIV');"
 onMouseOut=" MM_showHideLayers('overDiv','','hide');">
 <td></td>
</tr>
</table>

</BODY>
</HTML>
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值