大虾援手----如何实现如同http://www.microsoft.com/china/中的下拉菜单---200分

dongchuanlu 2002-05-07 04:16:16
如何实现如同”http://www.microsoft.com/china/“中的下拉菜单

领导的意思
我又是新手
(最好有原码)
分不够可以加
...全文
47 点赞 收藏 15
写回复
15 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
sook_l 2002-05-07
其实你要是不想看那么多的代码的话,去下载一个网页菜单工厂WebMenuShop

很好用的!:-)
回复
SUIFENG2002 2002-05-07
那是层的技术,要提取当然也可以,本来HTML就是可以用ASP嵌入的嘛。
怎么用层,看源代码就行。
回复
dongchuanlu 2002-05-07
多谢各位!
我希望菜单中的二级菜单能从access库中的表中动态提取(不要用dreamwear)
提供相关的介绍网站也行!

回复
许留心 2002-05-07
去http://www.windstudio.net/tech/show.asp?id=65 看看吧

授人以鱼,不如授人以渔,与其告诉你原代码,不如告诉怎样可以学会做它,这样多少年都不会忘记了。
回复
dongchuanlu 2002-05-07

qisanyou(www.qisanyou.com) 你好
可以发给我你的脚本文件吗?
zyq1630@163.com
回复
qisanyou 2002-05-07
给你发了短信息,可以看看我用的,虽然跟微软的有点不一样,其实是一样的.只不过颜色不一样而已.
回复
liuzxit 2002-05-07
以下三個文件就OK了﹐文件一是你要挂菜單的文件﹐文件三是設置菜單文件﹐文件二有興趣的可以看看﹐其實文件二你可以把它換成.js﹐很簡單﹐自己看吧。

===========a.htm文件一﹕=============打開的文件
<script src="banner.asp" ></script>
<script src="setmenu.js" ></script>
<script>drawBanner();</script>

================banner.asp文件內容=================
<% @Language="JScript" %>
<%
Response.buffer=true;
Response.Expires=0;
%>

// 图形大小 : 600x80
var BannerURL;
var BannerDesc;
var BannerBGColor;

var BannerNavBar=new Array();
// 文字颜色,指向颜色,背景颜色
var BannerNavBarColor=new Array("white","yellow","#0099FF");

var SubjBar=new Array();
var BackGroundColor="#ffffff";
var BackGroundIMG="";
var LeftBanner='';


function setBackGroundColor(strColor) {
BackGroundColor=strColor;
}
function setBackGroundIMG(strIMG) {
BackBackGroundIMG=strIMG;
}

function setBannerIMG(imgUrl,strDesc) {
BannerURL=imgUrl;
BannerDesc=strDesc;
}

function setBannerBGColor(bgcolor) {
BannerBGColor=bgcolor;
}

function setBannerNavBarColor(txtcolor,hovercolor,bgcolor) {
BannerNavBarColor[0]=txtcolor;
BannerNavBarColor[1]=hovercolor;
BannerNavBarColor[2]=bgground;
}


function addNav(strDesc,strURL,strTarget) {
var newNav=new addNavBar(strDesc,strURL,strTarget);
BannerNavBar[BannerNavBar.length++]=newNav;
return newNav;
}

function addNavBar(strDesc,strURL,strTarget) {
this.desc=strDesc;
this.url=(strURL) ? strURL : null;
this.target=(strTarget) ? strTarget : null;
this.submenu=new Array();
return this;
}

function drawBanner() {
document.write("<img src=Img/Title.jpg height=80 width=780>")
document.write("<style>" +
"body {font:12pt 新细明体;margin:0pt;background:" + BackGroundColor + " url('" + BackGroundIMG + "')}" +
"td,select,input {font:12pt 新细明体;}" +
".banbar {padding:2pt;color:#cc99cc;font:9pt;background:#ffffff;}" +
"a.banbar:link {color:#99cc99;text-decoration:underline}" +
"a.banbar:visited {color:#99cc99;text-decoration:none}" +
"a.banbar:active {color:#99cc99;text-decoration:none}" +
"a.banbar:hover {color:#cc99cc;text-decoration:underline}" +
".navbar {padding:2pt;color:"+BannerNavBarColor[0]+";font:10pt;background:" + BannerNavBarColor[2] + "}" +
"a.navbar:link {color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.navbar:visited {color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.navbar:active {color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.navbar:hover {color:"+BannerNavBarColor[1]+";text-decoration:underline}" +
".subnav {color:" + BannerNavBarColor[0] + ";font:10pt;background:" + BannerNavBarColor[2] + ";visibility:hidden;position:absolute;}" +
"a.subnav_a:link {font:10pt;color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.subnav_a:visited {color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.subnav_a:active {color:"+BannerNavBarColor[0]+";text-decoration:none}" +
"a.subnav_a:hover {color:"+BannerNavBarColor[1]+";text-decoration:underline}" +
"</style>");

tmp="<table border=0 cellpadding=4 cellspacing=0 width=100%><tr><td nowrap class=navbar>";
for (i=0;i<BannerNavBar.length;i++) {
if (BannerNavBar[i].url) {
tmp+="<a class=navbar href=" + BannerNavBar[i].url;
if (BannerNavBar[i].target) tmp+=" target=" + BannerNavBar[i].traget;
if (BannerNavBar[i].submenu.length>0)
tmp+=" onmouseover=showBaner(subnav" + i + ") onmouseout=hideBaner(subnav" + i + ")";
tmp+=">";
}
tmp+=BannerNavBar[i].desc;
if (BannerNavBar[i].url) tmp+="</a>";
tmp+=" | ";
}
tmp+="</td></tr></table>";
document.write(tmp);

for (i=0;i<BannerNavBar.length;i++) {
if (BannerNavBar[i].submenu.length>0) {
tmp="<table border=0 cellpadding=5 cellspacing=0 class=subnav id=subnav" + i + " onmouseover=showBaner(subnav" + i + ") onmouseout=hideBaner(subnav"+i+")>";
for (var j=0;j<BannerNavBar[i].submenu.length;j++) {
var m=BannerNavBar[i].submenu[j]
tmp+="<tr><td nowrap>"
if (m.url) {
tmp+="<a class=subnav_a href='" + m.url + "'";
if (m.target) tmp+=" target=" + m.target;
tmp+=">";
}
tmp+=m.desc;
if (m.url) tmp+="</a>";
tmp+="</td></tr>";
}
tmp+="</table>";
document.write(tmp);
}
}
resizeBanner();
}

function fadeIn(o) {
o.style.filter="blendTrans(duration=2)";
if (o.filters.blendTrans.status != 2) {
o.filters.blendTrans.apply();
o.style.visibility="visible";
o.filters.blendTrans.play();
}
}

function addSubj(strDesc,strURL,strTarget) {
SubjBar[SubjBar.length++]=new addSubjBar(strDesc,strURL,strTarget);
}

function addSubjBar(strDesc,strURL,strTarget) {
this.desc=strDesc;
this.url=(strURL) ? strURL : null;
this.target=(strTarget) ? strTarget : null;
return this;
}

function drawSubj() {
var tmp="<table border=0 cellpadding=3 cellspacing=0>";
for (var i=0;i<SubjBar.length;i++) {
tmp+="<tr><td>"
if (SubjBar[i].url) {
tmp+="<a href=" + SubjBar[i].url;
if (SubjBar[i].target) tmp+=" target=" + SubjBar[i].target;
tmp+=">";
}
tmp+=SubjBar[i].desc
if (SubjBar[i].url) tmp+="</a>";
tmp+="</td></tr>";
}
tmp+="</table>";
document.write(tmp);
}

function addSubNav(oparnent,sdesc,surl,starget) {
oparnent.submenu[oparnent.submenu.length++]=new addSubNavBar(sdesc,surl,starget);
}

function addSubNavBar(sdesc,surl,starget) {
this.desc=sdesc;
this.url=(surl) ? surl : null;
this.target=(starget) ? starget : null;
return this;
}


var tim,otim,posY1,posY2,menuSpeed=3;

function hideBaner(s) {
s.style.visibility="hidden";
}

function scrollMenu() {
if (posY1<posY2) {
posY1+=3;
otim.left=posY1;
tim=setTimeout("scrollMenu()",menuSpeed)
}
else {
clearTimeout(tim);
}
}

function showBaner(s) {
var e=window.event.srcElement;
if (e.className=="navbar") {
s.style.left=e.offsetLeft;
s.style.width=e.offsetWidth;
s.style.pixelTop=e.style.pixelTop+97;
}
s.style.visibility="visible";
}

===============setmenu.js內容﹕===============設置菜單項
var a=addNav(" 首页 ","/");
a=addNav(" 菜单一 ","/Topest.asp");
addSubNav(a,"子菜单一","/hjpp","_self");
addSubNav(a," 子菜单二","/call","_self");
addSubNav(a," 子菜单三"," /work/","_self");
a=addNav("  菜单一 ","/compter.asp");
addSubNav(a,"ABCD","/jobplan","_self");
addSubNav(a,"XYZ "," /price/manage_show.asp?abc=公告","_self");



順便告訴你可看
http://www.csdn.net/expert/topic/634/634519.xml?temp=.1354181
希望對你有用﹐也希望你不會象那個樓主沒信譽
回复
dongchuanlu 2002-05-07
来人哪!?????
回复
可爱的排骨 2002-05-07
看MS站上的源代码啊
回复
dongchuanlu 2002-05-07
微软上边的菜单
回复
superauu 2002-05-07
你要的是微软上边的菜单还是右边的能动的那个东西呀
回复
dongchuanlu 2002-05-07
superauu(superauu)
给个能调通的,简单,一点的
谢谢
回复
dongchuanlu 2002-05-07
稍等 我再看呢!
分会给的
回复
superauu 2002-05-07
快点给分呀。我编了好久的。
回复
superauu 2002-05-07
有一个类似的网页,你看看。

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>新建网页 1</title>
<base target="main">
<script>
function switchSysBar1(){
if (switchPoint1.innerText==6){
switchPoint1.innerText=5
document.all("first").style.display="none"
}else{
switchPoint1.innerText=6
document.all("first").style.display=""
}}
function switchSysBar2(){
if (switchPoint2.innerText==6){
switchPoint2.innerText=5
document.all("second").style.display="none"
}else{
switchPoint2.innerText=6
document.all("second").style.display=""
}}
</script>
<style>
<!--
body, p, td, input { color: #000000; font-size: 9pt }
-->
</style>
</head>

<body topmargin="0" leftmargin="0" onload="switchSysBar2();">

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%">
<iframe name="I1" scrolling="no" target="main" width="100%" height="60" border="0" frameborder="0" src="lefttopframe.asp">
</iframe></td>
</tr>
<tr>
<td bgcolor="#E1E1E1">
<table border="0" cellPadding="0" cellSpacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td onclick="switchSysBar1()" style="height: 100%"> <b>考生信息</b></td>
<td onclick="switchSysBar1()" style="height: 100%">
<p align="right">
<font style="color: #6699cc; cursor: hand; font-family: Webdings; font-size: 9pt">
<span id="switchPoint1">6</span></font>  </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" id="first">
<iframe name="I2" scrolling="no" target="main" height="110" width="100%" border="0" frameborder="0" src="leftmiddleframe.asp">
</iframe> </td>
</tr>
<tr>
<td bgcolor="#E1E1E1">
<table border="0" cellPadding="0" cellSpacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td onclick="switchSysBar2()" style="height: 100%"> <b>修改密码</b></td>
<td onclick="switchSysBar2()" style="height: 100%">
<p align="right">
<font style="color: #6699cc; cursor: hand; font-family: Webdings; font-size: 9pt">
<span id="switchPoint2">6</span></font>  </td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="second">
<iframe name="testinfo" scrolling="no" target="main" height="120" width="100%" border="0" frameborder="0" src="editpwd.asp">
</iframe></td>
</tr>
</table>

</body>

</html>

你拷贝下来,看看。
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2002-05-07 04:16
社区公告
暂无公告