劳驾各位高手说详细点。
參考答案:<SCRIPT language=javascript1.2>
function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
}
}
</SCRIPT>
<script>
var online= new Array();
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<table border="0" width="110" cellspacing="0" cellpadding="0">
<tr>
<td width="110" height="22" align="left" background="qqonline/topt.gif" id=menuTitle1 onclick="showsubmenu(6)"></td>
</tr>
<tr>
<td width="110" id='submenu6' style="display:">
<div class=sec_menu style="width:110">
<table cellpadding=0 cellspacing=0 align=center width=110>
<tr>
<td height="50" align="left" background="qqonline/top.gif"></td>
</tr>
<tr>
<td align="center" background="qqonline/middle.gif">
<table width="90" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"><a target=blank href='这里改为你的QQ号:4 border="0" align="absmiddle">
这里改为你的QQ昵称</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="110" height="15" align="center" background="qqonline/bottomt.gif"></td>
</tr></table></div>
</td>
</tr>
<tr>
<td width="110" height="35" align="center" background="qqonline/bottom.gif"></td>
</tr>
</table>
</layer>
<script type="text/javascript">
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
var startX =0,
startY = 230;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
参考资料: