怎样才能做出OICQ的菜单效果!! http://www.qisanyou.com/qq 要的话留下邮箱,我传给你. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE>Outlook ToolBar</TITLE> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> <META content="MSHTML 6.00.2600.0" name="GENERATOR"> <STYLE type="text/css">BODY { FONT-WEIGHT: normal; FONT-SIZE: 11pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal}.blue { COLOR: blue}.red { COLOR: red}INPUT { FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal}TD { FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal}</STYLE> <SCRIPT language="javascript"><!--//Size of buttons.var BTN_HEIGHT = 25;var BTN_WIDTH = 100;//Space between buttons.var BTN_SPACE =0;var ITM_HEIGHT = 80;var ITM_SPACE = 2;var ButtonCount = 0;var ItemCounts;var FocusButton;//reset postion of buttons and items, show clicked button's items, hide other items.function onBtnClick(btnIndex){ var i; var minHeight; var btmBtnTop; if ((btn < 0) || (btn >= ButtonCount)) return; document.body.scrollTop = 0; for(i=0; i<=btnIndex; i++) { var btn = document.all.item("BTN" + i); if (btn == null) alert("NULL BTN"); else btn.style.posTop = i * (BTN_HEIGHT + BTN_SPACE); }; //minimun height used by buttons and items. minHeight = ButtonCount * (BTN_HEIGHT + BTN_SPACE) - BTN_SPACE + ItemCounts[btnIndex] * (ITM_HEIGHT + ITM_SPACE); //calculate bottom button's start top position. if (minHeight > document.body.clientHeight) { document.body.setAttribute("SCROLL", "YES", false); btmBtnTop = (btnIndex+1) * (BTN_HEIGHT + BTN_SPACE) - BTN_SPACE + ItemCounts[btnIndex] * (ITM_HEIGHT + ITM_SPACE); } else { document.body.setAttribute("SCROLL", "NO", false); btmBtnTop = document.body.clientHeight - (ButtonCount - btnIndex -1) * (BTN_HEIGHT + BTN_SPACE); } for(i=btnIndex + 1; i<ButtonCount; i++) { var btn = document.all.item("BTN" + i); if (btn == null) alert("NULL BTN"); else btn.style.posTop = btmBtnTop; btmBtnTop += (BTN_HEIGHT + BTN_SPACE); }; var itmtop = (BTN_HEIGHT + BTN_SPACE) * (btnIndex + 1); for(i=0; i<ButtonCount; i++) for(j=0; j<ItemCounts[i]; j++) { var tbl = document.all.item("ITM" + i + "_" + j); if (null == tbl) continue; if (i == btnIndex) { tbl.style.posTop = itmtop + j * (ITM_HEIGHT + ITM_SPACE); tbl.style.visibility = "visible"; } else tbl.style.visibility = "hidden"; //tbl.style.display = "none"; } FocusButton = btnIndex;};function onResize(){ onBtnClick(FocusButton);}function constructmenu(){ var i,j; var str; str = ""; ItemCounts = new Array(); for(i=0; i<mytree.children.length; i++) { var item = mytree.children.item(i); str += '<INPUT TYPE="BUTTON" '+ 'ID="BTN' + i + '" '+ 'VALUE="' + item.getAttribute("VALUE") +'" ' + 'STYLE="position:absolute; HEIGHT: ' + BTN_HEIGHT + 'px; WIDTH: ' + BTN_WIDTH + 'px;" ' + 'ONCLICK="onBtnClick(' + i +');' + '">'; str += '\n<BR>'; ItemCounts[i] = 0; for(j=0; j < item.children.length; j++) { str += '<TABLE WIDTH=' + BTN_WIDTH + ' ID="ITM' + i + '_' + j + '" STYLE="position:absolute;">'; str += '<TR><TD ALIGN=CENTER>'; str += '<A HREF=' + item.children.item(j).getAttribute("HREF") + ' TARGET="CONTENTS">'; str += '<IMG SRC="' + item.children.item(j).getAttribute("IMGSRC") + '" ALIGN=CENTER STYLE="border:none;">'; str += '</A>'; str += '</TD></TR>'; str += '<TR><TD ALIGN=CENTER>'; str += item.children.item(j).getAttribute("VALUE"); str += '</TD></TR>'; str += '</TABLE>'; ItemCounts[i] ++; } ButtonCount ++; } menu.outerHTML = str; onBtnClick(0); //menu.innerText = str; FocusButton = 0; window.onresize = onResize;}//--></SCRIPT> </HEAD> <BODY leftMargin="0" onload="constructmenu()"> <UL id="mytree" style="DISPLAY: none"> <LI value="Mail"> <UL HREF="contents.htm" VALUE="InBox" IMGSRC="inbox.gif"> </UL> <UL HREF="contents.htm" VALUE="OutBox" IMGSRC="outbox.gif"> </UL> <UL HREF="contents.htm" VALUE="Sent" IMGSRC="sentitems.gif"> </UL> <UL HREF="contents.htm" VALUE="Deleted" IMGSRC="deleted.gif"> </UL> <LI value="Contacts"> <UL HREF="contents.htm" VALUE="Contacts" IMGSRC="contacts.gif"> </UL> <LI value="Other"> <UL HREF="contents.htm" VALUE="Journal" IMGSRC="journal.gif"> </UL> <UL HREF="contents.htm" VALUE="Tasks" IMGSRC="tasks.gif"> </UL> <UL HREF="contents.htm" VALUE="Notes" IMGSRC="notes.gif"> </UL> <UL HREF="contents.htm" VALUE="Calendar" IMGSRC="calendar.gif"> </UL> </LI> </UL> <DIV id="menu"></DIV> </BODY></HTML> 切换太快了,改慢点就更好了,hoho 我是一个初学者能把code发给我么看看么?想学习一下万分感谢!![email protected] http://www.qisanyou.com/qq作得很漂亮,你有没有整理出code来?发给我一份吧[email protected]谢谢 js取当前时间问题 怎么让用户的鼠标移到网页固定区域时变成我设计的鼠标样子 请问做flash小游戏需要什么js插件? onChange()提交不上去 onsubmit事件在firefox中不识别 怎么能让浏览器后退按钮失效? 编写 htc 时,遇到求知的运行时错误: element.innerHTML = strHTML; 怎样将光标定位到textarea的某一行? JavaScript宝典(第四版)e文原电子版 有多少人要 JQuery操作复选框的问题 挑战!能否用js语句得到ie收藏夹中的收藏链接? 如何做鼠标移到某主菜单,就会弹出子菜单
<HTML>
<HEAD>
<TITLE>Outlook ToolBar</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" name="GENERATOR">
<STYLE type="text/css">BODY {
FONT-WEIGHT: normal; FONT-SIZE: 11pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal
}
.blue {
COLOR: blue
}
.red {
COLOR: red
}
INPUT {
FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal
}
TD {
FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; LINE-HEIGHT: normal; FONT-STYLE: normal; FONT-VARIANT: normal
}
</STYLE>
<SCRIPT language="javascript">
<!--
//Size of buttons.
var BTN_HEIGHT = 25;
var BTN_WIDTH = 100;
//Space between buttons.
var BTN_SPACE =0;var ITM_HEIGHT = 80;
var ITM_SPACE = 2;var ButtonCount = 0;
var ItemCounts;
var FocusButton;
//reset postion of buttons and items, show clicked button's items, hide other items.
function onBtnClick(btnIndex)
{
var i;
var minHeight;
var btmBtnTop;
if ((btn < 0) || (btn >= ButtonCount)) return;
document.body.scrollTop = 0;
for(i=0; i<=btnIndex; i++)
{
var btn = document.all.item("BTN" + i);
if (btn == null)
alert("NULL BTN");
else
btn.style.posTop = i * (BTN_HEIGHT + BTN_SPACE);
};
//minimun height used by buttons and items.
minHeight = ButtonCount * (BTN_HEIGHT + BTN_SPACE) - BTN_SPACE + ItemCounts[btnIndex] * (ITM_HEIGHT + ITM_SPACE);
//calculate bottom button's start top position.
if (minHeight > document.body.clientHeight)
{
document.body.setAttribute("SCROLL", "YES", false);
btmBtnTop = (btnIndex+1) * (BTN_HEIGHT + BTN_SPACE) - BTN_SPACE + ItemCounts[btnIndex] * (ITM_HEIGHT + ITM_SPACE);
}
else
{
document.body.setAttribute("SCROLL", "NO", false);
btmBtnTop = document.body.clientHeight - (ButtonCount - btnIndex -1) * (BTN_HEIGHT + BTN_SPACE);
}
for(i=btnIndex + 1; i<ButtonCount; i++)
{
var btn = document.all.item("BTN" + i);
if (btn == null)
alert("NULL BTN");
else
btn.style.posTop = btmBtnTop;
btmBtnTop += (BTN_HEIGHT + BTN_SPACE);
};
var itmtop = (BTN_HEIGHT + BTN_SPACE) * (btnIndex + 1);
for(i=0; i<ButtonCount; i++)
for(j=0; j<ItemCounts[i]; j++)
{
var tbl = document.all.item("ITM" + i + "_" + j);
if (null == tbl) continue;
if (i == btnIndex)
{
tbl.style.posTop = itmtop + j * (ITM_HEIGHT + ITM_SPACE);
tbl.style.visibility = "visible";
}
else
tbl.style.visibility = "hidden";
//tbl.style.display = "none";
}
FocusButton = btnIndex;
};function onResize()
{
onBtnClick(FocusButton);
}function constructmenu()
{
var i,j;
var str;
str = "";
ItemCounts = new Array();
for(i=0; i<mytree.children.length; i++)
{
var item = mytree.children.item(i);
str += '<INPUT TYPE="BUTTON" '+
'ID="BTN' + i + '" '+
'VALUE="' + item.getAttribute("VALUE") +'" ' +
'STYLE="position:absolute; HEIGHT: ' + BTN_HEIGHT + 'px; WIDTH: ' + BTN_WIDTH + 'px;" ' +
'ONCLICK="onBtnClick(' + i +');' +
'">';
str += '\n<BR>';
ItemCounts[i] = 0;
for(j=0; j < item.children.length; j++)
{
str += '<TABLE WIDTH=' + BTN_WIDTH + ' ID="ITM' + i + '_' + j + '" STYLE="position:absolute;">';
str += '<TR><TD ALIGN=CENTER>';
str += '<A HREF=' + item.children.item(j).getAttribute("HREF") + ' TARGET="CONTENTS">';
str += '<IMG SRC="' + item.children.item(j).getAttribute("IMGSRC") + '" ALIGN=CENTER STYLE="border:none;">';
str += '</A>';
str += '</TD></TR>';
str += '<TR><TD ALIGN=CENTER>';
str += item.children.item(j).getAttribute("VALUE");
str += '</TD></TR>';
str += '</TABLE>';
ItemCounts[i] ++;
}
ButtonCount ++;
}
menu.outerHTML = str; onBtnClick(0);
//menu.innerText = str;
FocusButton = 0;
window.onresize = onResize;
}//-->
</SCRIPT>
</HEAD>
<BODY leftMargin="0" onload="constructmenu()">
<UL id="mytree" style="DISPLAY: none">
<LI value="Mail">
<UL HREF="contents.htm" VALUE="InBox" IMGSRC="inbox.gif">
</UL>
<UL HREF="contents.htm" VALUE="OutBox" IMGSRC="outbox.gif">
</UL>
<UL HREF="contents.htm" VALUE="Sent" IMGSRC="sentitems.gif">
</UL>
<UL HREF="contents.htm" VALUE="Deleted" IMGSRC="deleted.gif">
</UL>
<LI value="Contacts">
<UL HREF="contents.htm" VALUE="Contacts" IMGSRC="contacts.gif">
</UL>
<LI value="Other">
<UL HREF="contents.htm" VALUE="Journal" IMGSRC="journal.gif">
</UL>
<UL HREF="contents.htm" VALUE="Tasks" IMGSRC="tasks.gif">
</UL>
<UL HREF="contents.htm" VALUE="Notes" IMGSRC="notes.gif">
</UL>
<UL HREF="contents.htm" VALUE="Calendar" IMGSRC="calendar.gif">
</UL>
</LI>
</UL>
<DIV id="menu"></DIV>
</BODY>
</HTML>
能把code发给我么看看么?想学习一下
万分感谢!![email protected]
作得很漂亮,你有没有整理出code来?发给我一份吧
[email protected]
谢谢