javascript下拉菜单:如何链接到不同的网站?

时间:2010-10-24 19:45:53

标签: javascript html menu hyperlink drop-down-menu

我是一名大学生,试图为我的教授创建一个下拉菜单。由于我没有任何编程背景,我发现了一个名为"SoThink DHTML"的程序,它为我生成了一个代码,但是其中有一些错误,我不知道如何修复。

总的来说,菜单应该包含“主页”,“研究”(3个子标题:“研究项目”,“系统和方法”,“图像和电影”),“出版物”,“实验室成员”, “链接”和“联系我们。”然而,自动生成的代码不提供其中某些标题的链接,我想知道如何手动插入链接?

如何插入路径以便它们不引用特定文件,但在移动包含网站的文件夹时更灵活?

我希望这有点道理..

非常感谢你提前帮助!!

stm_bm(["menu1c53",960,"","blank.gif",0,"","",1,0,250,0,1000,1,0,0,"","100%",0,0,1,2,"default","hand","",1,25],this);
stm_bp("p0",[0,4,0,0,0,0,0,15,100,"",-2,"",-2,50,0,0,"#999999","transparent","line1.gif",3,0,0,"#000000"]);
stm_ai("p0i0",[0,"Home","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0,0,1,1,"#E6EFF9",1,"#E6EFF9",1,"","line2.gif",1,3,0,0,"#E6EFF9","#000000","#426b10","#426b10","bold 9pt Verdana","bold 9pt Verdana",0,0,"","line2.gif","","line2.gif",2,2,42],100,0);
stm_aix("p0i1","p0i0",[0,"Research","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow1.gif","arrow2.gif",15,9],100,0);
stm_bp("p1",[1,4,0,-3,6,0,5,0,100,"progid:DXImageTransform.Microsoft.RandomDissolve(,enabled=0,Duration=0.30)",12,"",-2,80,0,0,"#999999","#beeb94","",3,0,0,"#CCCCCC","",-1,-1,0,"transparent","",3,"",-1,-1,0,"transparent","",3,"line3.gif",-1,-1,0,"transparent","line3.gif",3,"",-1,-1,0,"transparent","",3,"","","","",1,1,1,1,1,1,1,1]);
stm_ai("p1i0",[0,"Research Projects","","",-1,-1,0,"./Research_Projects.html","_self","","","","",5,1,0,"","",0,0,0,0,1,"#E6EFF9",1,"#edf9e1",0,"","",3,3,0,0,"#E6EFF9","#000000","#426b10","#426b10","7pt Verdana","7pt Verdana",0,0,"","","","",0,0,0],0,20);
stm_aix("p1i1","p1i0",[0,"Systems and Approaches","","",-1,-1,0,"./Systems_and_Approaches.html"],0,20);
stm_aix("p1i2","p1i0",[0,"Images and Movies","","",-1,-1,0,"./Images_and_Movies.html"],0,20);
stm_mc("p1",[7,"#1E1E1E",1,2,"",3]);
stm_ep();
stm_aix("p0i2","p0i0",[0,"Publications","","",-1,-1,0,"#"],100,0);
stm_aix("p0i3","p0i2",[0,"Lab Members"],100,0);
stm_aix("p0i4","p0i2",[0,"Links"],100,0);
stm_aix("p0i5","p0i2",[0,"Contact Us"],100,0);
stm_ep();
stm_em();

1 个答案:

答案 0 :(得分:0)

看起来您正在使用相对网址,它会根据当前位置查找文件。因此,当包含网址的文件位于不同的位置时,它们意味着不同的东西。

../../public/img/logo.gif

绝对网址从网站的根目录开始,这意味着您可以将包含它们的文件移动到任何位置,它仍然会引用相同的位置。

http://www.somedomain.com/en/public/img/logo.gif

more on the difference(警告,获取技术)。