下拉菜单的制作[求助]

作者 TombCrow, 2004 九月 22, 19:45:56

« 上一篇主题 - 下一篇主题 »

subaru

那会不会是php的问题?
或者你引用地址有错

TombCrow

引用地址有错不应该是报js代码错误阿,应该是没有反应吧?
会不会是js冲突?不过如果是js冲突,应该是在html中直接写入也会报错的吧?但是现在直接写入可以,从外部导入就报错,一模一样的代码。
FNT,要抓狂了~~

subaru

每次都是说3**行少了")"?
你用DM把那个页打开~~~看看标签颜色有没不对的地方~~
你把代码帖出来下~还有文件地址

TombCrow

唉,还是得去下dw......晕~
代码生成的js还有首页的文件我先发给你吧

subaru


rainbow

......晕!机房还打烊?

subaru

收文件 http://qi5477.51.net/tcjj.rar
遗憾的是问题没有从根本上解决
但我发现了几个很奇怪的现象:
1首先把你的index的下面那些表格全部删掉,把与导航栏无关的代码全部删掉,只留有导航栏的一小块~~~预览没有导航栏
2然后我新建一个html文件,用链接的方式导入那个js文件~~能够看到导航栏
3把你的文件的原代码全部删掉,连<html>那些标签都不留,然后把上面那个文件的代码全部粘贴到你那去~~仍然不能看到导航栏
4用我2建的那个文件,把你原文件的其他代码粘过来~~可以看到导航栏
说明什么?

TombCrow

引用1首先把你的index的下面那些表格全部删掉,把与导航栏无关的代码全部删掉,只留有导航栏的一小块~~~预览没有导航栏
2然后我新建一个html文件,用链接的方式导入那个js文件~~能够看到导航栏
3把你的文件的原代码全部删掉,连那些标签都不留,然后把上面那个文件的代码全部粘贴到你那去~~仍然不能看到导航栏
4用我2建的那个文件,把你原文件的其他代码粘过来~~可以看到导航栏

晕~
2我是试过的,可以看到导航栏
问题是在我那个页面死活也显示不出来
说明什么??

TombCrow

我按你说的4试一下,你还真有办法......

subaru

文件你down了吗?那就是4
但我不知道上面那些还能连到数据库不~
还有一个~~如果你只用到二级彩旦~我还有个稍简单点的js,比那个小10kb左右

TombCrow

文件down了,导航栏正常,但是图象无法正常显示(路径是对的),看来这个导航栏真的没法用了。我只有二级菜单,给我看看那个js吧~不想用dw重做了~

subaru

:glare::( 不好意思啊~~我那个js也是这个人做的(就是说也要用DW),只不过算是你用的那个的前一个版本~~~

------------

var mmenus    = new Array();
var misShow   = new Boolean();
misShow=false;
var misdown   = new Boolean();
misdown=false;
var msrcel;
var mfromel;  
var mtoel;
var musestatus=false;
var mthestatus=\"\";
var mpopTimer = 0;
mmenucolor=\'#000000\';mfontcolor=\'#ffffff\';mmenuoutcolor=\'#ffffff\';mmenuincolor=\'#ffffff\';mmenuoutbordercolor=\'#666666\';mmenuinbordercolor=\'#666666\';mmidoutcolor=\'#ff0000\';mmidincolor=\'#ff0000\';mmenuovercolor=\'#000000\';mitemedge=\'0\';msubedge=\'1\';mmenuunitwidth=60;mmenuitemwidth=160;mmenuheight=22;mmenuwidth=\'500\';mmenuadjust=5;mmenuadjustV=-5;mfonts=\'font-family: 宋体; font-size: 9pt; color: #FFFFFF; \';mcursor=\'default\';
function stoperror(){
return true;
}
window.onerror=stoperror;
function mpopOut() {
mpopTimer = setTimeout(\'mallhide()\', 500);
}
function getReal(el, type, value) {
temp = el;
while ((temp != null) && (temp.tagName != \"BODY\")) {
 if (eval(\"temp.\" + type) == value) {
  el = temp;
  return el;
 }
 temp = temp.parentElement;
}
return el;
}


function mMenuRegister(menu)
{
 mmenus[mmenus.length] = menu
 return (mmenus.length - 1)
}
function mMenuItem(caption,command,target,isline,statustxt,img,sizex,sizey,pos){
this.caption=caption;
this.command=command;
this.target=target;
this.isline=isline;
this.statustxt=statustxt;
this.img=img;
this.sizex=sizex;
this.sizey=sizey;
this.pos=pos;
}
function mMenu(caption,command,target,img,sizex,sizey,pos){
this.items = new Array();
this.caption=caption;
this.command=command;
this.target=target;
this.img=img;
this.sizex=sizex;
this.sizey=sizey;
this.pos=pos;
this.id=mMenuRegister(this);
}
function mMenuAddItem(item)
{
 this.items[this.items.length] = item
 item.parent = this.id;
 this.children=true;
}

mMenu.prototype.addItem = mMenuAddItem;
function mtoout(src){

src.style.borderLeftColor=mmenuoutbordercolor;
src.style.borderRightColor=mmenuinbordercolor;
src.style.borderTopColor=mmenuoutbordercolor;
src.style.borderBottomColor=mmenuinbordercolor;
src.style.backgroundColor=mmenuoutcolor;
src.style.color=mmenuovercolor;
}
function mtoin(src){

src.style.borderLeftColor=mmenuinbordercolor;
src.style.borderRightColor=mmenuoutbordercolor;
src.style.borderTopColor=mmenuinbordercolor;
src.style.borderBottomColor=mmenuoutbordercolor;
src.style.backgroundColor=mmenuincolor;
src.style.color=mmenuovercolor;
}
function mnochange(src){
src.style.borderLeftColor=mmenucolor;
src.style.borderRightColor=mmenucolor;
src.style.borderTopColor=mmenucolor;
src.style.borderBottomColor=mmenucolor;
src.style.backgroundColor=\'\';
src.style.color=mfontcolor;

}
function mallhide(){
for(var nummenu=0;nummenudocument.body.clientWidth)
menuid.style.left=document.body.clientWidth-mmenuitemwidth;
menuid.style.visibility=\'visible\';
misShow=true;
}
function mmenu_over(menuid,x){
mtoel = getReal(window.event.toElement, \"className\", \"coolButton\");
mfromel = getReal(window.event.fromElement, \"className\", \"coolButton\");
if (mtoel == mfromel) return;
msrcel = window.event.srcElement;
if(x  mallhide();
 mtoin(msrcel);
 mmenushow(menuid,eval(\"mMenu\"+x));

}
clearTimeout(mpopTimer);
}
function mmenu_out(menuid){
mtoel = getReal(window.event.toElement, \"className\", \"coolButton\");
mfromel = getReal(window.event.fromElement, \"className\", \"coolButton\");
if (mtoel == mfromel) return;
msrcel = window.event.srcElement;
if (misShow){
mtoin(msrcel);
}else{
mnochange(msrcel);
}
mpopOut()
}
function mmenu_down(menuid,x){
msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
 if(misShow){
 mmenuhide(menuid);
 mtoout(msrcel);
 }
 else{
 mtoin(msrcel);
 mmenushow(menuid,eval(\"mMenu\"+x));
 misdown=true;
 }
}
function mmenu_up(){
 misdown=false;
}
function mmenuitem_over(menuid){
msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
if(misdown){
mtoin(msrcel);
}
else{
mtoout(msrcel);
}
if(mthestatus!=\"\"){
musestatus=true;
window.status=mthestatus;
}
clearTimeout(mpopTimer);
}
function mmenuitem_out(menuid){
msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
mnochange(msrcel);
if(musestatus)window.status=\"\";
mpopOut()
}
function mmenuitem_down(menuid){
msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
mtoin(msrcel)
misdown=true;
}
function mmenuitem_up(menuid){
msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
mtoout(msrcel)
misdown=false;
}
function mexec2(x){
var cmd;
if(mmenus
  • .target==\"blank\"){
     cmd = \"window.open(\'\"+mmenus
  • .command+\"\')\";
    }else{
     cmd = mmenus
  • .target+\".location=\'\"+mmenus
  • .command+\"\'\";
    }
    eval(cmd);
    }
    function mexec(x,i){
    var cmd;
    if(mmenus
  • .items.target==\"blank\"){
     cmd = \"window.open(\'\"+mmenus
    • .items.command+\"\')\";
      }else{
       cmd = mmenus
      • .items.target+\".location=\'\"+mmenus
        • .items.command+\"\'\";
          }
          eval(cmd);
          }
          function mbody_click(){

          if (misShow){
          msrcel = getReal(window.event.srcElement, \"className\", \"coolButton\");
          for(var x=0;x\'
                              for(var x=0;x\"+ifspace+thismenu.caption+\"\";
                                     }else if(thismenu.pos==\"1\"){
                                         stringx += \" align=center>\"+thismenu.caption+ifspace+\"\";
                                     }else if(thismenu.pos==\"2\"){
                                         stringx += \" align=center background=\"+thismenu.img+\">\"+thismenu.caption+\"\";
                                     }else{
                                         stringx += \" align=center>\"+thismenu.caption+\"\";
                                     }
                               stringx += \"\";
                              }
                              stringx+=\" \";
                             
                             
                              for(var x=0;x\';
                                 }else{
                                 stringx+=\'\\n\'+
                               \'\\n\'
                               for(var i=0;i\"+ifspace+thismenuitem.caption+\"\";
                                         }else if(thismenuitem.pos==\"1\"){
                                           stringx += \">\"+thismenuitem.caption+ifspace+\"\";
                                         }else if(thismenuitem.pos==\"2\"){
                                           stringx += \"background=\"+thismenuitem.img+\">\"+thismenuitem.caption+\"\";
                                         }else{
                                           stringx += \">\"+thismenuitem.caption+\"\";
                                         }
              }else{
                                stringx+=\'\\n\';
                                }
                               }stringx+=\'\\n\'
                               }
                               
                         }
                         
                              document.write(\"\"+stringx+\"\");
               break
             }
           }
          }


          function document_load(){
          mwritetodocument();


          }mpmenu1=new mMenu(\'首页\',\'../../index.htm\',\'self\',\'回首页\',\'\',\'\',\'\',\'\');
          mpmenu1.addItem(new mMenuItem(\'音乐小站\',\'../musicmain.htm\',\'self\',false,\'音乐小站\',\'\',\'\',\'\',\'\'));
          mpmenu1.addItem(new mMenuItem(\'暂无\',\'\',\'\',\'\',\'\',\'\',\'\'));
          mpmenu1.addItem(new mMenuItem(\'暂无\',\'\',\'\',\'\',\'\',\'\',\'\',\'\'));
          mpmenu1.addItem(new mMenuItem(\'关于祺\',\'javascript:alert(\"未完成\")\',\'self\',false,\'未完成\',\'\',\'\',\'\',\'\'));
          mpmenu2=new mMenu(\'Enigma相关\',\'\',\'self\',\'\',\'\',\'\',\'\');
          mpmenu2.addItem(new mMenuItem(\'Biography\',\'bio.htm\',\'self\',false,\'Biography For Enigma and Michael Cretu\',\'\',\'\',\'\',\'\'));
          mpmenu2.addItem(new mMenuItem(\'已出专辑\',\'disco.htm\',\'self\',false,\'未完成\',\'\',\'\',\'\',\'\'));
          mpmenu2.addItem(new mMenuItem(\'有关评论\',\'wenzhai.htm\',\'self\',false,\'一些抄来的文章\',true));
          mpmenu2.addItem(new mMenuItem(\'歌词\',\'1st.htm\',\'blank\',false,\'歌词\',\'\',\'\',\'\',\'\'));
          mpmenu2.addItem(new mMenuItem(\'相关链接\',\'links.htm\',\'self\',false,\'提供一些相关网站\',\'\',\'\',\'\',\'\'));
          mpmenu3=new mMenu(\'友情链接\',\'../../links.htm\',\'blank\',false,\'\',\'\',\'\',\'\');
          mpmenu3.addItem(new mMenuItem(\'成都七中未来梦\',\'http://www.cdqz.com\',\'blank\',false,\'我的高中^_^\',\'\',\'\',\'\',\'\'));
          mpmenu3.addItem(new mMenuItem(\'高中校友录\',\'flydae4120.alumni.chinaren.com\',\'blank\',false,\'Sohu上的校友录\',\'\',\'\',\'\',\'\'));
          mpmenu3.addItem(new mMenuItem(\'摇友之家\',\'http://www.rockbbs.com\',\'blank\',false,\'摇友之家\',\'\',\'\',\'\',\'\'));
          mpmenu3.addItem(new mMenuItem(\'古墓丽影专题站论坛\',\'http://www.lara.com.cn\',\'blank\',false,\'劳拉,我的最爱^_^\',\'\',\'\',\'\',\'\'));
          mpmenu3.addItem(new mMenuItem(\'更多......\',\'../../links.htm\',\'blank\',false,\'更多友情链接\',\'\',\'\',\'\',\'\'));
          mpmenu4=new mMenu(\'联系祺\',\'\',\'self\',\'\',\'\',\'\',\'\');
          mpmenu4.addItem(new mMenuItem(\'QQ:10173015\',\'\',\'\',false,\'QQ:10173015\',\'\',\'\',\'\',\'\'));
          mpmenu4.addItem(new mMenuItem(\'E-mail Me\',\'mailto:subaru_00@msn.com\',\'self\',false,\'给我写Email\',\'\',\'\',\'\',\'\'));
          mpmenu4.addItem(new mMenuItem(\'给我留言\',\'http://www.0044.net/index.asp?boardID=1948\',\'blank\',false,\'从申请的留言板\',\'\',\'\',\'\',\'\'));

          ----------------------

          上面的用引用

          然后在紧接一句document_load()

          但是这个我在你的最初那个页面上试过,仍然不行


rainbow

哇~~~~~好长!我不行了,看晕了~~

TombCrow

这个小多了,多谢~~
看来是不能从外部导入了,呵呵

subaru

恩?怎么回突然变成斜体了?不会有什么问题吧
这个文件 http://qi5477.51.net/JavaScript/Enigma.js