用javascript如何实现OICQ的界面

zf_sxl 2002-04-08 06:03:53
多谢了!!!!!!!!!!!!!!!!!
...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
linhaibo 2002-04-10
  • 打赏
  • 举报
回复
呵呵...
孟子E章 2002-04-09
  • 打赏
  • 举报
回复
<script language="JavaScript">
<!--
//该函数在调用过程中只需要在将要点击的单元格内的onclick事件中调用showme函数即可
//function showme(obj1, obj2)该函数主要为使点击的对象高亮度显示,并调用moveme函数,参数obj1为母体即<div>标签的id,obj2为点击对象本身
//function moveme(obj)该函数判断单元的移动,并调用相应的函数处理,obj参数为母体
//function moveup(obj,objtop)该函数使一个单元向上移动,参数obj为母体,objtop为母体的本身最高高度
//function movedown(obj,objbuttom)该函数使一个单元向下移动,参数obj为母体,objbuttom为母体的本身最低高度

var headHeight = 22;//每个标题的高度
var bodyHeight = 160;//母体高度
var objcount = 6;//项目的个数,要改变了项目的个数别忘了该这个东西
var step = 6;//移动速度(请确认可以被'bodyHeight-headHeight'整除,当前的设定可选速度为1,2,3,6,23,138)
var moving = false;//是否有移动的项目

function showme(obj1, obj2)
{
//以下循环为改变标题的背景颜色
if (moving)
//return;
// moving = true;
for(i=0;i<document.all.tags("td").length;i++)
if (document.all.tags("td")[i].className.indexOf('headtd') == 0)
document.all.tags("td")[i].className = 'headtd1';
obj2.className = 'headtd2';
moveme(obj1);
}

function moveme(obj)
{
idnumber = parseInt(obj.id.substr(4));
objtop = headHeight * (idnumber - 1);
objbuttom = bodyHeight + headHeight * (idnumber - 2);
currenttop = parseInt(obj.style.top);
if (currenttop >= objbuttom)
{
//检验出每一个应该向上移动的层
countid = 1;
for(i=0;i<document.all.tags("div").length;i++)
if (document.all.tags("div")[i].id == 'item'+countid+'body')
{
obj = document.all.tags("div")[i];
objtop = headHeight * (countid - 1);
if (countid == idnumber)
{
moveup(obj,objtop,false);
break;
}
else
moveup(obj,objtop,true);
countid++;
}
}
else if ((currenttop <= objtop) && (idnumber < objcount))
{
//检验出每一个应该向下移动的层
idnumber++;
countid = objcount;
for(i=document.all.tags("div").length-1;i>=0;i--)
if (document.all.tags("div")[i].id == 'item'+countid+'body')
{
obj = document.all.tags("div")[i];
objbuttom = bodyHeight + headHeight * (countid - 2);
if (countid == idnumber)
{
movedown(obj,objbuttom,false);
break;
}
else
movedown(obj,objbuttom,true);
countid--;
}
}
}

function moveup(obj,objtop,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop > objtop)
{
obj.style.top = currenttop - step;
setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1)
return;
}
//moving = ismove;
}

function movedown(obj,objbuttom,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop < objbuttom)
{
obj.style.top = currenttop + step;
setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1)
return;
}
//moving = ismove;
}
// -->
</script>
<style type="text/css">
<!--
.headtd1 { background: #00A4E1; border: 2px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}
.headtd2 { background: #20C1FF; border: 2px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}
.bodytd { background: #99CCFF; border: 2px outset; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}
-->
</style>
<!--改改这个div(mainboard)的height,加一个项目当然要把它的值加22了,减一个项目当然就是减22了//-->
<div id="mainboard" style="position:absolute; left:2px; top:2px; width:120px; height:270px; z-index:3; overflow: hidden; background: #0099FF;" onclick="">
<div id="item1body" style="position:absolute; left:0; top:0; width:120px; height:160px; z-index:1; overflow: hidden">
<table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
<tr>
<td id="item1head" height="20" class="headtd2" onclick="showme(item1body,this)">
<div align="center">工作室</div>
</td>
</tr>
<tr>
<td class="bodytd">
<div align="center"><a href="http://www.jzzy.com">建站资源网</a></div>
</td>
</tr>
</table>
</div>
<div id="item2body" style="position:absolute; left:0px; top:160; width:120; height:160; z-index:2; overflow: hidden">
<table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
<tr>
<td id="item2head" height="20" class="headtd1" onclick="showme(item2body,this)">
<div align="center">邮箱</div>
</td>
</tr>
<tr>
<td class="bodytd">
<div align="center"><a href="mailto:webmaster@jzzy.com">发信给我哟</a></div>
</td>
</tr>
</table>
<p class="headtd1"> </p>
</div>
<div id="item3body" style="position:absolute; left:0; top:182; width:120px; height:160; z-index:3">
<table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
<tr>
<td id="item3head" height="20" class="headtd1" onclick="showme(item3body,this)">
<div align="center">Q Q</div>
</td>
</tr>
<tr>
<td class="bodytd">
<div align="center">37146743</div>
</td>
</tr>
</table>
</div>
<div id="item4body" style="position:absolute; left:0; top:204; width:120px; height:160; z-index:4; overflow: hidden">
<table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
<tr>
<td id="item4head" height="20" class="headtd1" onclick="showme(item4body,this)">
<div align="center">朋友</div>
</td>
</tr>
<tr>
<td class="bodytd">
<div align="center">
<p>小一、旁腾<br>
</p>
</div>
</td>
</tr>
</table>
</div>
</div>
seabell 2002-04-09
  • 打赏
  • 举报
回复
用幀的一种方法
<frameset rows="24,24,*" name="frm_tree" noresize border="0" framespacing="0">
<frame name="frm_mail" src="mailtree.htm" scrolling="auto" frameborder="NO" noresize>
<frame name="frm_viewpic" src="viewpictree.htm" scrolling="auto" frameborder="NO" noresize>
<frame name="frm_product" src="producttree.htm" scrolling="auto" frameborder="NO" noresize>
</frameset>

mailtree.htm
<body bgcolor="#FFFFFF" text="#000000" onload="content.style.display='none'">
<table width=100% style="border:1px,1px,1px,1px outset"><tr><td style="cursor:hand" onclick="top.frm_product.content.style.display='none';top.frm_viewpic.content.style.display='none';content.style.display='block';top.frm_tree.rows='*,24,24'">
邮件管理</td></tr></table>
<div id=content>
<p> mail </p>
</div>
</body>

viewpictree.htm
<body bgcolor="#FFFFFF" text="#000000" onload="content.style.display='none'">
<table width=100% style="border:1px,1px,1px,1px outset"><tr><td style="cursor:hand" onclick="top.frm_mail.content.style.display='none';top.frm_product.content.style.display='none';content.style.display='block';top.frm_tree.rows='24,*,24'">
图档浏览</td></tr></table>
<div id=content>
<p> viewpic </p>
</div>
</body>

producttree.htm
<body bgcolor="#FFFFFF" text="#000000" onload="content.style.display='block'">
<form name="form1" method="post" action="">
<table width=100% style="border:1px,1px,1px,1px outset"><tr><td style="cursor:hand" onclick="top.frm_mail.content.style.display='none';top.frm_viewpic.content.style.display='none';content.style.display='block';top.frm_tree.rows='24,24,*'">
产品设计管理</td></tr></table>
<div id=content>
<p> product </p>
</div>
</body>
flylyke 2002-04-09
  • 打赏
  • 举报
回复
孟兄,你的那个向下就不行了
weidegong 2002-04-09
  • 打赏
  • 举报
回复
http://go3.163.com/websdk/dhtml/myjssamples/oltoolbar/index.htm

直接另存为就可以得到代码了

kkk2kkk 2002-04-08
  • 打赏
  • 举报
回复
试了试,不错!再加工一下可以仿OUTLOOK界面
rangq1 2002-04-08
  • 打赏
  • 举报
回复
本人做了一个大概的框架,见笑了
<html>
<head>
<title>webplayer</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.menuFrame
{
width:133px;
top: 30px;
border:1 inset black;
overflow:auto;
bgcolor:buttonface;
}
</style>
<script language="javascript">
function QQStyle(objMove)
{
if(!bQQMoveOver)return;
bQQMoveOver = false;
var nQQLen = 3;
var strId = objMove.id;
var nId = parseInt(strId.substring(strId.length - 1));
var strName = strId.substring(0,strId.length - 1)
var bDown = false;
var bUp = false;
var nCurrentPos = parseInt(objMove.style.top);
var nPreviousPos = -1;
if(nId != 0)nPreviousPos = parseInt(eval(strName + (nId - 1) + ".style.top"));
var nNextPos = -1;
if(nId != nQQLen - 1)nNextPos = parseInt(eval(strName + (nId + 1) + ".style.top"));

if(nId == 0)
{
if(nCurrentPos == nNextPos)bUp = true;
if(nNextPos != nCurrentPos)bDown = true;
}
else if(nId == nQQLen - 1)
{
if(nCurrentPos != nPreviousPos)bUp = true;
if(nCurrentPos == nPreviousPos)bDown = true;
}
else
{
if(nNextPos != nCurrentPos)bDown = true;
if(nCurrentPos != nPreviousPos)bUp = true;
}
objQQ = objMove;
if(bDown)QQMovedown();
else if(bUp)QQMoveup();
else bQQMoveOver = true;
}
var nQQEnd = 180;
var objQQ = null;
var nQQStep = 20;
var bQQMoveOver = true;
function QQMovedown()
{
if(parseInt(objQQ.style.top) < nQQEnd && objQQ != null)
{
objQQ.style.top = parseInt(objQQ.style.top) + nQQStep;
setTimeout("QQMovedown()", 10);
}
else bQQMoveOver = true;
}
function QQMoveup()
{
if(parseInt(objQQ.style.top) > 0 && objQQ != null)
{
objQQ.style.top = parseInt(objQQ.style.top) - nQQStep;
setTimeout("QQMoveup()", 10);
}
else bQQMoveOver = true;
}
</script>
</head>
<body text="#000000" bgcolor="#CCCC99">
<div id="Layer12" style="position:absolute; z-index:12; left: 20px; height: 250" class="menuFrame" >
<div id="QQMove0" style="position:relative; top:0;width:130px; height:10; z-index:1;cursor:hand;border:2 outset buttonhighlight;" onClick="QQStyle(this);">XML</div>
<div id="QQMove1" style="position:relative; top:0;width:130px; height:10; z-index:1;cursor:hand;border:2 outset buttonhighlight" onClick="QQStyle(this);">HTML</div>
<div id="QQMove2" style="position:relative; top:0;width:130px; height:10; z-index:1;cursor:hand;border:2 outset buttonhighlight" onClick="QQStyle(this);">ORACLE</div>
<div id="QQContent" style="position:relative;top:0;width:130px; height:10; z-index:1;"></div>
</div>

</body>
</html>

604

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 控件与界面
社区管理员
  • 控件与界面社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧