Sun

01

Mar

2009

89、透明的下拉展开菜单

89、透明的下拉展开菜单

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT language=jscript>

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='#009AFF';mfontcolor='#FFFFFF';mmenuoutcolor='#009AFF';mmenuincolor='#009AFF';mmenuoutbordercolor='#009AFF';mmenuinbordercolor='#009AFF';mmidoutcolor='#0099FF';mmidincolor='#0099FF';mmenuovercolor='#FF0000';mitemedge='0';msubedge='1';mmenuunitwidth=60;mmenuitemwidth=160;mmenuheight=22;mmenuwidth='500';mmenuadjust=10;mmenuadjustV=0;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;nummenu<mmenus.length;nummenu++){

              var themenu=document.all['mMenu'+nummenu]

              var themenudiv=document.all['mmenudiv'+nummenu]

                mnochange(themenu);

                mmenuhide(themenudiv);

                }

}

function mmenuhide(menuid){

menuid.style.filter='Alpha(Opacity=100)';

menuid.style.visibility='hidden';

misShow=false;

}

function mmenushow(menuid,pid){

menuid.style.filter='Alpha(Opacity=80)';

menuid.style.left=mposflag.offsetLeft+pid.offsetLeft+mmenuadjust;menuid.style.top=mposflag.offsetTop+mmenutable.offsetHeight+mmenuadjustV+1;

if(mmenuitemwidth+parseInt(menuid.style.left)>document.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<0){

  misShow = false;

  mallhide();

  mtoout(msrcel);

}else{

 

  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[x].target=="blank"){

  cmd = "window.open('"+mmenus[x].command+"')";

}else{

  cmd = mmenus[x].target+".location='"+mmenus[x].command+"'";

}

eval(cmd);

}

function mexec(x,i){

var cmd;

if(mmenus[x].items[i].target=="blank"){

  cmd = "window.open('"+mmenus[x].items[i].command+"')";

}else{

  cmd = mmenus[x].items[i].target+".location='"+mmenus[x].items[i].command+"'";

}

eval(cmd);

}

function mbody_click(){

 

if (misShow){

       msrcel = getReal(window.event.srcElement, "className", "coolButton");

       for(var x=0;x<=mmenus.length;x++){

              if(msrcel.id=="mMenu"+x)

              return;

       }

       mallhide();

}

}

document.onclick=mbody_click;

var mMenuBodyRef;

function mwritetodocument(){

      var mwb=1;

      for(var i in document.all){

              if (document.all[i].tagName == 'BODY'){

                     mMenuBodyRef = document.all[i]

                     var stringx='<div id="mposflag" style="position:absolute;"></div><table  id=mmenutable border=0 cellpadding=0 cellspacing=2 width='+mmenuwidth+' height='+mmenuheight+' bgcolor='+mmenucolor+

                     ' onselectstart="event.returnValue=false"'+

                     ' style="filter:Alpha(Opacity=80);cursor:'+mcursor+';'+mfonts+

                     ' border-left: '+mwb+'px solid '+mmenuoutbordercolor+';'+

                     ' border-right: '+mwb+'px solid '+mmenuinbordercolor+'; '+

                     'border-top: '+mwb+'px solid '+mmenuoutbordercolor+'; '+

                     'border-bottom: '+mwb+'px solid '+mmenuinbordercolor+'; padding:0px"><tr>'

                     for(var x=0;x<mmenus.length;x++){

                          var thismenu=mmenus[x];

                          var imgsize;

                                if(thismenu.sizex=="0"&&thismenu.sizey=="0"){

                                  imgsize="";

                                }else{

                                  imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;

                                }

                          var ifspace;

                                if(thismenu.caption==""){

                                  ifspace="";

                                }else{

                                  ifspace=" ";

                                }

                          stringx += "<td class=coolButton id=mMenu"+x+" style='border: "+mitemedge+"px solid "+mmenucolor+

                          "' width="+mmenuunitwidth+"px onmouseover=mmenu_over(mmenudiv"+x+

                          ","+x+") onmouseout=mmenu_out(mmenudiv"+x+

                          ") onmousedown=mmenu_down(mmenudiv"+x+","+x+")";

                                if(thismenu.command!=""){

                                    stringx += " onmouseup=mexec2("+x+");mmenu_up();";

                                }else{

                                      stringx += " onmouseup=mmenu_up()";

                                }

                                if(thismenu.pos=="0"){

                                    stringx += " align=center><img align=absmiddle src="+thismenu.img+imgsize+">"+ifspace+thismenu.caption+"</td>";    

                                }else if(thismenu.pos=="1"){

                                    stringx += " align=center>"+thismenu.caption+ifspace+"<img align=absmiddle src="+thismenu.img+imgsize+"></td>";     

                                }else if(thismenu.pos=="2"){

                                    stringx += " align=center background="+thismenu.img+">"+thismenu.caption+"</td>";      

                                }else{

                                    stringx += " align=center>"+thismenu.caption+"</td>";

                                }

                          stringx += "";

                     }

                     stringx+="<td width=*> </td></tr></table>";

                    

                    

                     for(var x=0;x<mmenus.length;x++){

                          thismenu=mmenus[x];

                        if(x<0){

                        stringx+='<div id=mmenudiv'+x+' style="visiable:none"></div>';

                        }else{

                        stringx+='<div id=mmenudiv'+x+

                        ' style="filter:Alpha(Opacity=80);cursor:'+mcursor+';position:absolute;'+

                        'width:'+mmenuitemwidth+'px; z-index:'+(x+100);

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                        stringx+=';border-left: 1px solid '+mmidoutcolor+

                        ';border-top: 1px solid '+mmidoutcolor;}

                        stringx+=';border-right: 1px solid '+mmenuinbordercolor+

                        ';border-bottom: 1px solid '+mmenuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+

                          '<table  width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+

                          'style="'+mfonts+' border-left: 1px solid '+mmenuoutbordercolor;

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                          stringx+=';border-right: 1px solid '+mmidincolor+

                          ';border-bottom: 1px solid '+mmidincolor;}

                          stringx+=';border-top: 1px solid '+mmenuoutbordercolor+

                          ';padding: 4px" bgcolor='+mmenucolor+'>\n'

                          for(var i=0;i<thismenu.items.length;i++){

                                 var thismenuitem=thismenu.items[i];

                                 var imgsize;

                                    if(thismenuitem.sizex=="0"&&thismenuitem.sizey=="0"){

                                       imgsize=""

                                    }else{

                                       imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey

                                    }

                                  var ifspace;

                                    if(thismenu.caption==""){

                                      ifspace="";

                                    }else{

                                      ifspace=" ";

                                    }

                                 if(!thismenuitem.isline){

                                 stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% height=15px onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(mmenudiv"+x+

                                 ");\" onmouseout=mmenuitem_out(mmenudiv"+x+

                                 ") onmousedown=mmenuitem_down(mmenudiv"+x+") onmouseup=";

                           stringx += "mexec("+x+","+i+");mmenuitem_up(mmenudiv"+x+") ";

                           if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";     

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td></tr>";     

                                    }else if(thismenuitem.pos=="2"){

                                     stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td></tr>";      

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td></tr>";

                                    }

                           }else{

                                 stringx+='<tr><td height="1" background="hr.gif"><img border="0" src="none.gif" width="1" height="1"></td></tr>\n';

                                 }

                          }stringx+='</table>\n</div>'

                          }

                         

                }

               

                     document.write("<div align='left'>"+stringx+"</div>");

      break

    }

  }

}

 

 

function document_load(){

       mwritetodocument();

 

 

}mpmenu1=new mMenu('文件','','self','','','','');

mpmenu1.addItem(new mMenuItem('新建','javascript:alert("新建")','self',false,'新建','','','',''));

mpmenu1.addItem(new mMenuItem('打开','javascript:alert("打开")','self',false,'打开','','','',''));

mpmenu1.addItem(new mMenuItem('保存','javascript:alert("保存")','self',false,'保存','','','',''));

mpmenu1.addItem(new mMenuItem(null,null,null,true));

mpmenu1.addItem(new mMenuItem('退出','javascript:alert("退出")','self',false,'退出','','','',''));

mpmenu2=new mMenu('编辑','','self','','','','');

mpmenu2.addItem(new mMenuItem('撤销','javascript:alert("撤销")','self',false,'撤销','','','',''));

mpmenu2.addItem(new mMenuItem('重做','javascript:alert("重做")','self',false,'重做','','','',''));

mpmenu2.addItem(new mMenuItem(null,null,null,true));

mpmenu2.addItem(new mMenuItem('拷贝','javascript:alert("拷贝")','self',false,'拷贝','','','',''));

mpmenu2.addItem(new mMenuItem('粘贴','javascript:alert("粘贴")','self',false,'粘贴','','','',''));

mpmenu3=new mMenu('收藏','','self','','','','');

mpmenu3.addItem(new mMenuItem('我的主页','http://www.7stk.com','blank',false,'访问我的主页','','','',''));

mpmenu3.addItem(new mMenuItem('Yahoo','http://www.yahoo.com','blank',false,'访问Yahoo','','','',''));

mpmenu4=new mMenu('帮助','','self','','','','');

mpmenu4.addItem(new mMenuItem('内容','javascript:alert("内容")','self',false,'内容','','','',''));

mpmenu4.addItem(new mMenuItem('给我写email','mailto:webmaster@7stk.com','self',false,'给我写email','','','',''));

mpmenu4.addItem(new mMenuItem(null,null,null,true));

mpmenu4.addItem(new mMenuItem('关于','javascript:alert("关于")','self',false,'关于这个软件','','','',''));

 

</SCRIPT>

<SCRIPT>document_load()</SCRIPT>

 

0 Comments

Sun

01

Mar

2009

90、快速展开的下拉菜单

90、快速展开的下拉菜单

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT language=jscript>

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='Menu';mfontcolor='MenuText';mmenuoutcolor='#000084';mmenuincolor='#000084';mmenuoutbordercolor='#FFFFFF';mmenuinbordercolor='#000000';mmidoutcolor='#E2DFDA';mmidincolor='#8D8A85';mmenuovercolor='#FFFFFF';mitemedge='0';msubedge='0';mmenuunitwidth=60;mmenuitemwidth=160;mmenuheight=30;mmenuwidth='100%';mmenuadjust=0;mmenuadjustV=0;mfonts='font-family: 宋体; font-size: 9pt; color: MenuText; ';mcursor='default';

var swipeSteps = 4;

var swipemsec = 25;

var swipeArray = new Array();

function swipe(el, dir, steps, msec) {

       if (steps == null) steps = swipeSteps;

       if (msec == null) msec = swipemsec;

       if (el.swipeIndex == null)

              el.swipeIndex = swipeArray.length;

       if (el.swipeTimer != null)

              window.clearTimeout(el.swipeTimer);

       swipeArray[el.swipeIndex] = el;

       el.style.clip = "rect(-99999, 99999, 99999, -99999)";

       if (el.swipeCounter == null) {

              el.orgLeft  = el.offsetLeft;

              el.orgTop  = el.offsetTop;

              el.orgWidth = el.offsetWidth;

              el.orgHeight  = el.offsetHeight;

       }

       else if (el.swipeCounter == 0) {

              el.orgLeft  = el.offsetLeft;

              el.orgTop  = el.offsetTop;

              el.orgWidth = el.offsetWidth;

              el.orgHeight  = el.offsetHeight;

       }

       el.style.left = el.orgLeft;

       el.style.top  = el.orgTop;

       el.swipeCounter = steps;

       el.style.clip = "rect(0,0,0,0)";

       window.setTimeout("repeat(" + dir + "," + el.swipeIndex + "," + steps + "," + msec + ")", msec);

}

function repeat(dir, index, steps, msec) {

       el = swipeArray[index];

       var left   = el.orgLeft;

       var top    = el.orgTop;

       var width  = el.orgWidth;

       var height = el.orgHeight;

       if (el.swipeCounter == 0) {

              el.style.clip = "rect(-99999, 99999, 99999, -99999)";

              return;

       }

       else {

              el.swipeCounter--;

              el.style.visibility = "visible";

              switch (dir) {

                     case 2:

                            el.style.clip = "rect(" + height*el.swipeCounter/steps + "," + width + "," + height + "," + 0 + ")";

                            el.style.top  = top - height*el.swipeCounter/steps;

                            break;

                     case 8:

                            el.style.clip = "rect(" + 0 + "," + width + "," + height*(steps-el.swipeCounter)/steps + "," + 0 + ")";

                            el.style.top  = top + height*el.swipeCounter/steps;

                            break;

                     case 6:

                            el.style.clip = "rect(" + 0 + "," + width + "," + height + "," + width*(el.swipeCounter)/steps + ")";

                            el.style.left  = left - width*el.swipeCounter/steps;

                            break;

                     case 4:

                            el.style.clip = "rect(" + 0 + "," + width*(swipeSteps - el.swipeCounter)/steps + "," + height + "," + 0 + ")";

                            el.style.left  = left + width*el.swipeCounter/steps;

                            break;

              }

             

              el.swipeTimer = window.setTimeout("repeat(" + dir + "," + index + "," + steps + "," + msec + ")", msec);

       }

}

function hideSwipe(el) {

       window.clearTimeout(el.swipeTimer);

       el.style.visibility = "hidden";

       el.style.clip = "rect(-99999, 99999, 99999, -99999)";

       el.swipeCounter = 0;

}

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;nummenu<mmenus.length;nummenu++){

              var themenu=document.all['mMenu'+nummenu]

              var themenudiv=document.all['mmenudiv'+nummenu]

                mnochange(themenu);

                mmenuhide(themenudiv);

                }

}

function mmenuhide(menuid){

hideSwipe(menuid);

misShow=false;

}

function mmenushow(menuid,pid){

menuid.style.left=mposflag.offsetLeft+pid.offsetLeft+mmenuadjust;menuid.style.top=mposflag.offsetTop+mmenutable.offsetHeight+mmenuadjustV;

swipe(menuid,2,4);

if(mmenuitemwidth+parseInt(menuid.style.left)>document.body.clientWidth)

menuid.style.left=document.body.clientWidth-mmenuitemwidth;

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<0){

  misShow = false;

  mallhide();

  mtoout(msrcel);

}else{

 

  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[x].target=="blank"){

  cmd = "window.open('"+mmenus[x].command+"')";

}else{

  cmd = mmenus[x].target+".location='"+mmenus[x].command+"'";

}

eval(cmd);

}

function mexec(x,i){

var cmd;

if(mmenus[x].items[i].target=="blank"){

  cmd = "window.open('"+mmenus[x].items[i].command+"')";

}else{

  cmd = mmenus[x].items[i].target+".location='"+mmenus[x].items[i].command+"'";

}

eval(cmd);

}

function mbody_click(){

 

if (misShow){

       msrcel = getReal(window.event.srcElement, "className", "coolButton");

       for(var x=0;x<=mmenus.length;x++){

              if(msrcel.id=="mMenu"+x)

              return;

       }

       mallhide();

}

}

document.onclick=mbody_click;

var mMenuBodyRef;

function mwritetodocument(){

      var mwb=1;

      for(var i in document.all){

              if (document.all[i].tagName == 'BODY'){

                     mMenuBodyRef = document.all[i]

                     var stringx='<div id="mposflag" style="position:absolute;"></div><table  id=mmenutable border=0 cellpadding=0 cellspacing=2 width='+mmenuwidth+' height='+mmenuheight+' bgcolor='+mmenucolor+

                     ' onselectstart="event.returnValue=false"'+

                     ' style="cursor:'+mcursor+';'+mfonts+

                     ' border-left: '+mwb+'px solid '+mmenuoutbordercolor+';'+

                     ' border-right: '+mwb+'px solid '+mmenuinbordercolor+'; '+

                     'border-top: '+mwb+'px solid '+mmenuoutbordercolor+'; '+

                     'border-bottom: '+mwb+'px solid '+mmenuinbordercolor+'; padding:0px"><tr>'

                     for(var x=0;x<mmenus.length;x++){

                          var thismenu=mmenus[x];

                          var imgsize;

                                if(thismenu.sizex=="0"&&thismenu.sizey=="0"){

                                  imgsize="";

                                }else{

                                  imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;

                                }

                          var ifspace;

                                if(thismenu.caption==""){

                                  ifspace="";

                                }else{

                                  ifspace=" ";

                                }

                          stringx += "<td class=coolButton id=mMenu"+x+" style='border: "+mitemedge+"px solid "+mmenucolor+

                          "' width="+mmenuunitwidth+"px onmouseover=mmenu_over(mmenudiv"+x+

                          ","+x+") onmouseout=mmenu_out(mmenudiv"+x+

                          ") onmousedown=mmenu_down(mmenudiv"+x+","+x+")";

                                if(thismenu.command!=""){

                                    stringx += " onmouseup=mexec2("+x+");mmenu_up();";

                                }else{

                                      stringx += " onmouseup=mmenu_up()";

                                }

                                if(thismenu.pos=="0"){

                                    stringx += " align=center><img align=absmiddle src="+thismenu.img+imgsize+">"+ifspace+thismenu.caption+"</td>";    

                                }else if(thismenu.pos=="1"){

                                    stringx += " align=center>"+thismenu.caption+ifspace+"<img align=absmiddle src="+thismenu.img+imgsize+"></td>";     

                                }else if(thismenu.pos=="2"){

                                    stringx += " align=center background="+thismenu.img+">"+thismenu.caption+"</td>";      

                                }else{

                                    stringx += " align=center>"+thismenu.caption+"</td>";

                                }

                          stringx += "";

                     }

                     stringx+="<td width=*> </td></tr></table>";

                    

                    

                     for(var x=0;x<mmenus.length;x++){

                          thismenu=mmenus[x];

                        if(x<0){

                        stringx+='<div id=mmenudiv'+x+' style="visiable:none"></div>';

                        }else{

                        stringx+='<div id=mmenudiv'+x+

                        ' style="cursor:'+mcursor+';position:absolute;'+

                        'width:'+mmenuitemwidth+'px; z-index:'+(x+100);

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                        stringx+=';border-left: 1px solid '+mmidoutcolor+

                        ';border-top: 1px solid '+mmidoutcolor;}

                        stringx+=';border-right: 1px solid '+mmenuinbordercolor+

                        ';border-bottom: 1px solid '+mmenuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+

                          '<table  width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+

                          'style="'+mfonts+' border-left: 1px solid '+mmenuoutbordercolor;

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                          stringx+=';border-right: 1px solid '+mmidincolor+

                          ';border-bottom: 1px solid '+mmidincolor;}

                          stringx+=';border-top: 1px solid '+mmenuoutbordercolor+

                          ';padding: 4px" bgcolor='+mmenucolor+'>\n'

                          for(var i=0;i<thismenu.items.length;i++){

                                 var thismenuitem=thismenu.items[i];

                                 var imgsize;

                                    if(thismenuitem.sizex=="0"&&thismenuitem.sizey=="0"){

                                       imgsize=""

                                    }else{

                                       imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey

                                    }

                                  var ifspace;

                                    if(thismenu.caption==""){

                                      ifspace="";

                                    }else{

                                      ifspace=" ";

                                    }

                                 if(!thismenuitem.isline){

                                 stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% height=15px onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(mmenudiv"+x+

                                 ");\" onmouseout=mmenuitem_out(mmenudiv"+x+

                                 ") onmousedown=mmenuitem_down(mmenudiv"+x+") onmouseup=";

                           stringx += "mexec("+x+","+i+");mmenuitem_up(mmenudiv"+x+") ";

                           if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";     

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td></tr>";     

                                    }else if(thismenuitem.pos=="2"){

                                     stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td></tr>";      

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td></tr>";

                                    }

                           }else{

                                 stringx+='<tr><td height="1" background="hr.gif"><img border="0" src="none.gif" width="1" height="1"></td></tr>\n';

                                 }

                          }stringx+='</table>\n</div>'

                          }

                         

                }

                

                     document.write("<div align='left'>"+stringx+"</div>");

      break

    }

  }

}

 

 

function document_load(){

       mwritetodocument();

 

 

}mpmenu1=new mMenu('文件','','self','','','','');

mpmenu1.addItem(new mMenuItem('新建','javascript:alert("新建")','self',false,'新建','','','',''));

mpmenu1.addItem(new mMenuItem('打开','javascript:alert("打开")','self',false,'打开','','','',''));

mpmenu1.addItem(new mMenuItem('保存','javascript:alert("保存")','self',false,'保存','','','',''));

mpmenu1.addItem(new mMenuItem(null,null,null,true));

mpmenu1.addItem(new mMenuItem('退出','javascript:alert("退出")','self',false,'退出','','','',''));

mpmenu2=new mMenu('编辑','','self','','','','');

mpmenu2.addItem(new mMenuItem('撤销','javascript:alert("撤销")','self',false,'撤销','','','',''));

mpmenu2.addItem(new mMenuItem('重做','javascript:alert("重做")','self',false,'重做','','','',''));

mpmenu2.addItem(new mMenuItem(null,null,null,true));

mpmenu2.addItem(new mMenuItem('拷贝','javascript:alert("拷贝")','self',false,'拷贝','','','',''));

mpmenu2.addItem(new mMenuItem('粘贴','javascript:alert("粘贴")','self',false,'粘贴','','','',''));

mpmenu3=new mMenu('收藏','','self','','','','');

mpmenu3.addItem(new mMenuItem('我的主页','http://www.7stk.com','blank',false,'访问我的主页','','','',''));

mpmenu3.addItem(new mMenuItem('Yahoo','http://www.yahoo.com.cn','blank',false,'访问Yahoo','','','',''));

mpmenu4=new mMenu('帮助','','self','','','','');

mpmenu4.addItem(new mMenuItem('内容','javascript:alert("内容")','self',false,'内容','','','',''));

mpmenu4.addItem(new mMenuItem('给我写email','mailto:webmaster@7stk.com','self',false,'给我写email','','','',''));

mpmenu4.addItem(new mMenuItem(null,null,null,true));

mpmenu4.addItem(new mMenuItem('关于','javascript:alert("关于")','self',false,'关于这个软件','','','',''));

 

</SCRIPT>

<SCRIPT>document_load()</SCRIPT>

 

 

 

0 Comments

Sun

01

Mar

2009

88、下拉多层展开菜单

88、下拉多层展开菜单

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT language=jscript>

var mmenus    = new Array();

var misShow   = new Boolean();

misShow=false;

var misdown   = new Boolean();

misdown=false;

var msrcel;

var mfromel; 

var mtoel;

var mnumberofsub=0;

var musestatus=false;

var mthestatus="";

var mpopTimer = 0;

mmenucolor='Menu';mfontcolor='MenuText';mmenuoutcolor='#B5BED6';mmenuincolor='#B5BED6';mmenuoutbordercolor='#000000';mmenuinbordercolor='#000000';mmidoutcolor='#8D8A85';mmidincolor='#8D8A85';mmenuovercolor='MenuText';mitemedge='0';msubedge='1';mmenuunitwidth=65;mmenuitemwidth=160;mmenuheight=30;mmenuwidth='100%';mmenuadjust=0;mmenuadjustV=-4;mfonts='font-family: 宋体; font-size: 9pt; color: MenuText; ';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,level,img,sizex,sizey,pos){

       this.items = new Array();

       this.caption=caption;

       this.command=command;

       this.target=target;

       this.isline=isline;

       this.statustxt=statustxt;

       if(level!=null){mnumberofsub++;

       this.hasc=mnumberofsub;}

       this.level=level;

       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;

mMenuItem.prototype.addsubItem = mMenuAddItem;

 

function mtoout(src){

src.style.border='solid 1';

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.border='solid 1';

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;

src.style.border='solid 0';

}

function mallhide(){

       for(var nummenu=0;nummenu<mmenus.length;nummenu++){

              var themenu=document.all['mMenu'+nummenu]

              var themenudiv=document.all['mmenudiv'+nummenu]

                mnochange(themenu);

                mmenuhide(themenudiv);

                }

        for(nummenu=1;nummenu<=mnumberofsub;nummenu++){ 

               var thesub=document.all['msubmenudiv'+nummenu]     

               msubmenuhide(thesub);

               mnochange(document.all['mp'+nummenu]);

               document.all["mitem"+nummenu].style.color=mfontcolor;

               }

}

function mmenuhide(menuid){

menuid.style.visibility='hidden';

misShow=false;

}

function msubmenuhide(menuid){

menuid.style.visibility='hidden';

}

function mmenushow(menuid,pid){

menuid.style.left=mposflag.offsetLeft+pid.offsetLeft+mmenuadjust;menuid.style.top=mposflag.offsetTop+mmenutable.offsetHeight+mmenuadjustV;

menuid.style.visibility='visible';

if(mmenuitemwidth+parseInt(menuid.style.left)>document.body.clientWidth)

menuid.style.left=document.body.clientWidth-mmenuitemwidth;

misShow=true;

}

function mshowsubmenu(menuid,pid,rid){

menuid.style.left=pid.offsetWidth+rid.offsetLeft;

menuid.style.top=pid.offsetTop+rid.offsetTop;

menuid.style.visibility='visible';

if(mmenuitemwidth+parseInt(menuid.style.left)>document.body.clientWidth)

menuid.style.left=document.body.clientWidth-mmenuitemwidth;

}

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<0){

  misShow = false;

  mallhide();

  mtoout(msrcel);

}else{

 

  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,item){

msrcel = getReal(window.event.srcElement, "className", "coolButton");

        for(nummenu=1;nummenu<=mnumberofsub;nummenu++){ 

               var thesub=document.all['msubmenudiv'+nummenu]

               if(!(menuid==thesub||menuid.style.tag>=thesub.style.tag)){

               msubmenuhide(thesub);

               mnochange(document.all['mp'+nummenu]);

               document.all["mitem"+nummenu].style.color=mfontcolor;

               }

        }

if(item)document.all["mitem"+item].style.color=mmenuovercolor;

if(misdown||item){

       mtoin(msrcel);

}

else{

       mtoout(msrcel);

}

if(mthestatus!=""){

       musestatus=true;

       window.status=mthestatus;

}

clearTimeout(mpopTimer);

}

function mmenuitem_out(menuid,hassub){

msrcel = getReal(window.event.srcElement, "className", "coolButton");

if(!hassub)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 mexec3(j,i){

var cmd;

if(eval("msub"+j).items[i].target=="blank"){

  cmd = "window.open('"+eval("msub"+j).items[i].command+"')";

}else{

  cmd = eval("msub"+j).items[i].target+".location='"+eval("msub"+j).items[i].command+"'";

}

eval(cmd);

}

function mexec2(x){

var cmd;

if(mmenus[x].target=="blank"){

  cmd = "window.open('"+mmenus[x].command+"')";

}else{

  cmd = mmenus[x].target+".location='"+mmenus[x].command+"'";

}

eval(cmd);

}

function mexec(x,i){

var cmd;

if(mmenus[x].items[i].target=="blank"){

  cmd = "window.open('"+mmenus[x].items[i].command+"')";

}else{

  cmd = mmenus[x].items[i].target+".location='"+mmenus[x].items[i].command+"'";

}

eval(cmd);

}

function mbody_click(){

 

if (misShow){

       msrcel = getReal(window.event.srcElement, "className", "coolButton");

       for(var x=0;x<=mmenus.length;x++){

              if(msrcel.id=="mMenu"+x)

              return;

       }

       for(x=1;x<=mnumberofsub;x++){

              if(msrcel.id=="mp"+x)

              return;

       }

       mallhide();

}

}

document.onclick=mbody_click;

var mMenuBodyRef;

function mwritetodocument(){

      var mwb=1;

      for(var i in document.all){

              if (document.all[i].tagName == 'BODY'){

                     mMenuBodyRef = document.all[i]

                     var stringx='<div id="mposflag" style="position:absolute;"></div><table  id=mmenutable border=0 cellpadding=0 cellspacing=2 width='+mmenuwidth+' height='+mmenuheight+' bgcolor='+mmenucolor+

                     ' onselectstart="event.returnValue=false"'+

                     ' style="cursor:'+mcursor+';'+mfonts+

                     ' border-left: '+mwb+'px solid '+mmenuoutbordercolor+';'+

                     ' border-right: '+mwb+'px solid '+mmenuinbordercolor+'; '+

                     'border-top: '+mwb+'px solid '+mmenuoutbordercolor+'; '+

                     'border-bottom: '+mwb+'px solid '+mmenuinbordercolor+'; padding:0px"><tr>'

                     for(var x=0;x<mmenus.length;x++){

                          var thismenu=mmenus[x];

                          var imgsize;

                                if(thismenu.sizex=="0"&&thismenu.sizey=="0"){

                                  imgsize="";

                                }else{

                                  imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;

                                }

                          var ifspace;

                                if(thismenu.caption==""){

                                  ifspace="";

                                }else{

                                  ifspace=" ";

                                }

                          stringx += "<td class=coolButton id=mMenu"+x+" style='border: "+mitemedge+"px solid "+mmenucolor+

                          "' width="+mmenuunitwidth+"px onmouseover=mmenu_over(mmenudiv"+x+

                          ","+x+") onmouseout=mmenu_out(mmenudiv"+x+

                          ") onmousedown=mmenu_down(mmenudiv"+x+","+x+")";

                                if(thismenu.command!=""){

                                    stringx += " onmouseup=mexec2("+x+");mmenu_up();";

                                }else{

                                      stringx += " onmouseup=mmenu_up()";

                                }

                                if(thismenu.pos=="0"){

                                    stringx += " align=center><img align=absmiddle src="+thismenu.img+imgsize+">"+ifspace+thismenu.caption+"</td>";    

                                }else if(thismenu.pos=="1"){

                                    stringx += " align=center>"+thismenu.caption+ifspace+"<img align=absmiddle src="+thismenu.img+imgsize+"></td>";     

                                }else if(thismenu.pos=="2"){

                                    stringx += " align=center background="+thismenu.img+">"+thismenu.caption+"</td>";      

                                }else{

                                    stringx += " align=center>"+thismenu.caption+"</td>";

                                }

                          stringx += "";

                     }

                     stringx+="<td width=*> </td></tr></table>";

                    

                    

                     for(var x=0;x<mmenus.length;x++){

                          thismenu=mmenus[x];

                        if(x<0){

                        stringx+='<div id=mmenudiv'+x+' style="visiable:none"></div>';

                        }else{

                        stringx+='<div id=mmenudiv'+x+

                        ' style="cursor:'+mcursor+';position:absolute;'+

                        'width:'+mmenuitemwidth+'px; z-index:'+(x+100);

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                        stringx+=';border-left: 1px solid '+mmidoutcolor+

                        ';border-top: 1px solid '+mmidoutcolor;}

                        stringx+=';border-right: 1px solid '+mmenuinbordercolor+

                        ';border-bottom: 1px solid '+mmenuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+

                          '<table background="../image/xpbg.gif" width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+

                          'style="'+mfonts+' border-left: 1px solid '+mmenuoutbordercolor;

                          if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                          stringx+=';border-right: 1px solid '+mmidincolor+

                          ';border-bottom: 1px solid '+mmidincolor;}

                          stringx+=';border-top: 1px solid '+mmenuoutbordercolor+

                          ';padding: 4px" bgcolor='+mmenucolor+'>\n'

                          for(var i=0;i<thismenu.items.length;i++){

                                 var thismenuitem=thismenu.items[i];

                                 var imgsize;

                                    if(thismenuitem.sizex=="0"&&thismenuitem.sizey=="0"){

                                       imgsize=""

                                    }else{

                                       imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey

                                    }

                                  var ifspace;

                                    if(thismenu.caption==""){

                                      ifspace="";

                                    }else{

                                      ifspace=" ";

                                    }

                                 if(thismenuitem.hasc!=null){

                                 stringx += "<tr><td id=mp"+thismenuitem.hasc+" class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% onmouseout=mmenuitem_out(mmenudiv"+x+

                                 ",true) onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(mmenudiv"+x+

                                 ",'"+thismenuitem.hasc+"');mshowsubmenu(msubmenudiv"+thismenuitem.hasc+",mp"+thismenuitem.hasc+",mmenudiv"+x+");\""+

                                 "><table id=mitem"+thismenuitem.hasc+" cellspacing='0' cellpadding='0' border='0' width='100%' style='"+mfonts+"'><tr><td ";

                                   if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td><td"; 

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td><td";

                                    }else if(thismenuitem.pos=="2"){

                                      stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td><td background="+thismenuitem.img;

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td><td";

                                    }

                                   stringx += " align=right width='1'><font face='Webdings' style='font-size: 6pt'>4</font></td></tr></table></td></tr>\n";                             

                                 }else if(!thismenuitem.isline){

                                 stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% height=15px onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(mmenudiv"+x+

                                 ");\" onmouseout=mmenuitem_out(mmenudiv"+x+

                                 ") onmousedown=mmenuitem_down(mmenudiv"+x+") onmouseup=";

                           stringx += "mexec("+x+","+i+");mmenuitem_up(mmenudiv"+x+") ";

                             if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";     

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td></tr>";     

                                    }else if(thismenuitem.pos=="2"){

                                     stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td></tr>";      

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td></tr>";

                                    }

                           }else{

                                 stringx+='<tr><td height="1" background="hr.gif"><img border="0" src="none.gif" width="1" height="1"></td></tr>\n';

                                 }

                          }stringx+='</table>\n</div>'

                          }                        

                }

               

for(var j=1;j<=mnumberofsub;j++){    

thisitem=eval("msub"+j);

stringx+='<div id=msubmenudiv'+j+

                        ' style="tag:'+thisitem.level+';cursor:'+mcursor+';position:absolute;'+

                        'width:'+mmenuitemwidth+'px; z-index:'+(j+200);

                        if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                        stringx+=';border-left: 1px solid '+mmidoutcolor+

                        ';border-top: 1px solid '+mmidoutcolor;}

                        stringx+=';border-right: 1px solid '+mmenuinbordercolor+

                        ';border-bottom: 1px solid '+mmenuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+

                          '<table background="../image/xpbg.gif" width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+

                          'style="'+mfonts+' border-left: 1px solid '+mmenuoutbordercolor;

                          if(mmenuinbordercolor!=mmenuoutbordercolor&&msubedge=="0"){

                          stringx+=';border-right: 1px solid '+mmidincolor+

                          ';border-bottom: 1px solid '+mmidincolor;}

                          stringx+=';border-top: 1px solid '+mmenuoutbordercolor+

                          ';padding: 4px" bgcolor='+mmenucolor+'>\n'

                          for(var i=0;i<thisitem.items.length;i++){

                                 var thismenuitem=thisitem.items[i];

                                 var imgsize;

                                    if(thismenuitem.sizex=="0"&&thismenuitem.sizey=="0"){

                                       imgsize=""

                                    }else{

                                       imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey

                                    }

                                  var ifspace;

                                    if(thismenu.caption==""){

                                      ifspace="";

                                    }else{

                                      ifspace=" ";

                                    }

                                 if(thismenuitem.hasc!=null){

                                 stringx += "<tr><td id=mp"+thismenuitem.hasc+" class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% onmouseout=mmenuitem_out(msubmenudiv"+j+

                                 ",true) onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(msubmenudiv"+j+

                                 ",'"+thismenuitem.hasc+"');mshowsubmenu(msubmenudiv"+thismenuitem.hasc+",mp"+thismenuitem.hasc+",msubmenudiv"+j+");\""+

                                 "><table id=mitem"+thismenuitem.hasc+" cellspacing='0' cellpadding='0' border='0' width='100%' style='"+mfonts+"'><tr><td ";

                                   if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td><td"; 

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td><td";

                                    }else if(thismenuitem.pos=="2"){

                                      stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td><td background="+thismenuitem.img;

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td><td";

                                    }

                                   stringx += " align=right width='1'><font face='Webdings' style='font-size: 6pt'>4</font></td></tr></table></td></tr>\n";                             

                                 }else if(!thismenuitem.isline){

                                 stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mmenucolor+

                                 "' width=100% height=15px onmouseover=\"mthestatus='"+thismenuitem.statustxt+"';mmenuitem_over(msubmenudiv"+j+

                                 ");\" onmouseout=mmenuitem_out(msubmenudiv"+j+

                                 ") onmousedown=mmenuitem_down(msubmenudiv"+j+") onmouseup=";

                                 stringx += "mexec3("+j+","+i+");mmenuitem_up(msubmenudiv"+j+") ";

                           if(thismenuitem.pos=="0"){

                                      stringx += "><img align=absmiddle src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";     

                                    }else if(thismenuitem.pos=="1"){

                                      stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src="+thismenuitem.img+imgsize+"></td></tr>";     

                                    }else if(thismenuitem.pos=="2"){

                                     stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td></tr>";      

                                    }else{

                                      stringx += ">"+thismenuitem.caption+"</td></tr>";

                                    }

                                  }else{

                                 stringx+='<tr><td height="1" background="hr.gif"><img border="0" src="none.gif" width="1" height="1"></td></tr>\n';

                                 }

                          }

stringx+='</table>\n</div>'

}

       document.write("<div align='left'>"+stringx+"</div>");

      break

    }

  }

}

 

 

function document_load(){

       mwritetodocument();

 

 

}mpmenu1=new mMenu('文件','','self','','','','');

msub1=new mMenuItem('新建','','self',false,'','1','../image/new.gif','0','0','0');

msub1.addsubItem(new mMenuItem('文档','','self',false,'',null,'../image/win16.gif','0','0','0'));

msub1.addsubItem(new mMenuItem('网页','','self',false,'',null,'../image/blank.gif','16','16','0'));

msub1.addsubItem(new mMenuItem('快捷方式','','self',false,'',null,'../image/blank.gif','16','16','0'));

mpmenu1.addItem(msub1);

mpmenu1.addItem(new mMenuItem('打开','','self',false,'',null,'../image/open.gif','0','0','0'));

mpmenu1.addItem(new mMenuItem('保存','','self',false,'',null,'../image/save.gif','0','0','0'));

mpmenu2=new mMenu('编辑','','self','','','','');

mpmenu2.addItem(new mMenuItem('撤销','','self',false,'',null,'../image/undo.gif','0','0','0'));

mpmenu2.addItem(new mMenuItem('重做','','self',false,'',null,'../image/redo.gif','0','0','0'));

mpmenu2.addItem(new mMenuItem('拷贝','','self',false,'',null,'../image/copy.gif','0','0','0'));

mpmenu3=new mMenu('帮助','','self','','','','');

mpmenu3.addItem(new mMenuItem('帮助','','self',false,'',null,'../image/help.gif','0','0','0'));

mpmenu3.addItem(new mMenuItem('主页','','self',false,'',null,'../image/home.gif','0','0','0'));

mpmenu3.addItem(new mMenuItem('邮件','','self',false,'',null,'../image/mail.gif','0','0','0'));

mpmenu3.addItem(new mMenuItem('搜索','','self',false,'',null,'../image/view.gif','0','0','0'));

 

</SCRIPT>

<SCRIPT>document_load()</SCRIPT>

 

0 Comments

Sun

01

Mar

2009

87、页面左侧的导航条

87、页面左侧的导航条

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

<!--

 

a{text-decoration:none;color:#000000;font-size:8pt;font-family:verdana}

//-->

</style>

<script language="JavaScript">

<!--

 

 

 

var top=50;

 

var left=0;

 

var bordercolor="#000000";

 

var bgcolorLight="#EFEFEF";

 

var bgcolorDark="#DFDFDF";

 

 

 

 

um1 = new Array("Menu1",

"Link1_um1", "http://www.7stk.com/",

"Link2_um1", "http://www.7stk.com/",

"Link3_um1", "http://www.7stk.com/",

"Link4_um1", "http://www.7stk.com/",

"Link5_um1", "http://www.7stk.com/",

"Link6_um1", "http://www.7stk.com/")

 

um2 = new Array("Menu2",

"Link1_um2", "http://www.7stk.com/",

"Link2_um2", "http://www.7stk.com/",

"Link3_um2", "http://www.7stk.com/",

"Link4_um2", "http://www.7stk.com/")

 

um3 = new Array("Menu3",

"Link1_um3", "http://www.7stk.com/",

"Link2_um3", "http://www.7stk.com/",

"Link3_um3", "http://www.7stk.com/",

"Link4_um3", "http://www.7stk.com/",

"Link5_um3", "http://www.7stk.com/",

"Link6_um3", "http://www.7stk.com/",

"Link7_um3", "http://www.7stk.com/",

"Link8_um3", "http://www.7stk.com/",

"Link9_um3", "http://www.7stk.com/",

"Link10_um3", "http://www.7stk.com/",

"Link11_um3", "http://www.7stk.com/",

"Link12_um3", "http://www.7stk.com/",

"Link13_um3", "http://www.7stk.com/",

"Link14_um3", "http://www.7stk.com/",

"Link15_um3", "http://www.7stk.com/")

//-->

</script>

<script language="JavaScript">

<!--

 

function checkBrowser(){

this.ver=navigator.appVersion

this.dom=document.getElementById?1:0

this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;

this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;

this.ie4=(document.all && !this.dom)?1:0;

this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

this.ns4=(document.layers && !this.dom)?1:0;

this.mac=(this.ver.indexOf('Mac') > -1) ?1:0;

this.ope=(navigator.userAgent.indexOf('Opera')>-1);

this.ie=(this.ie6 || this.ie5 || this.ie4)

this.ns=(this.ns4 || this.ns5)

this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4 || this.mac || this.ope)

this.nbw=(!this.bw)

return this}

bw=new checkBrowser()

 

var um1length = ((um1.length-1)/2);

var um2length = ((um2.length-1)/2);

var um3length = ((um3.length-1)/2);

 

var um1nr = 0;

var um1nr2 = 1;

var um1nr3 = 2;

var um2nr = 0;

var um2nr2 = 1;

var um2nr3 = 2;

var um3nr = 0;

var um3nr2 = 1;

var um3nr3 = 2;

 

init();

 

function init()

{

if(bw.ie6 || bw.ie4 || bw.ie5){

height=document.body.offsetHeight-4;

document.write('<div id="menubg" style="position:absolute;top:0;left:'+left+';background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;height:'+height+';border-top-width:0px">')

document.write('</div>')

document.write('<div id="m" style="position:absolute;top:'+top+';left:'+left+'">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m1_ie()">'+um1[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um1" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">');

}

else if(bw.ns4){

height=innerHeight;

document.write('<layer id="menubg" position="absolute" top="0" left="'+left+'" bgcolor="'+bordercolor+'" width="127" height="'+(height)+'">')

document.write('</layer>')

document.write('<layer id="menubg2" position="absolute" top="0" left="'+(left+1)+'" bgcolor="'+bgcolorLight+'" width="125" height="'+(height-1)+'">')

document.write('</layer>')

document.write('<layer id="m" position="absolute" top="50" left="'+(left+1)+'">')

document.write('<layer bgcolor="'+bordercolor+'" width="125">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bgcolorDark+'" width="125" position="absolute" top="1" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m1_n()">'+um1[0]+'</a></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bordercolor+'" width="125" position="absolute" top="21" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer id="um1" position="absolute" top="22" left="0" bgcolor="'+bgcolorLight+'" width="125">')

document.write('<table align="center">')

}

else if(bw.ns5){

height=innerHeight-1;

document.write('<div id="menubg" style="position:absolute;top:0;left:'+left+';background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;height:'+height+';border-top-width:0px">')

document.write('</div>')

document.write('<div id="m" style="position:absolute;top:'+top+';left:'+left+'">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m1_n6()">'+um1[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um1" style="position:absolute;top:18;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

else{

height=document.body.offsetHeight-4;

document.write('<div id="menubg" style="position:absolute;top:0;left:'+left+';background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;height:'+height+';border-top-width:0px">')

document.write('</div>')

document.write('<div id="m" style="position:absolute;top:'+top+';left:'+left+'">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="#">'+um1[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um1" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

init2();

}

function init2()

{

if(um1nr < um1length){

document.write('<tr><td align="center"><a href="'+um1[um1nr3]+'">'+um1[um1nr2]+'</a></td></tr>');

um1nr++;

um1nr2=um1nr2+2;

um1nr3=um1nr3+2;

init2();

}

else{

init3();

}

}

function init3()

{

if(bw.ie6 || bw.ie4 || bw.ie5){

document.write('</table>')

document.write('</div>')

document.write('<div id="m1" style="position:absolute;top:20;left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m2_ie()">'+um2[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um2" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

else if(bw.ns4){

document.write('</table>')

document.write('</layer>')

document.write('<layer id="m1" position="absolute" top="21" left="0">')

document.write('<layer bgcolor="'+bordercolor+'" width="125">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bgcolorDark+'" width="125" position="absolute" top="1" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m2_n()">'+um2[0]+'</a></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bordercolor+'" width="125" position="absolute" top="21" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer id="um2" position="absolute" top="22" left="0" bgcolor="'+bgcolorLight+'" width="125">')

document.write('<table align="center">')

}

else if(bw.ns5){

document.write('</table>')

document.write('</div>')

document.write('<div id="m1" style="position:absolute;top:18;left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m2_n6()">'+um2[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um2" style="position:absolute;top:18;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

else{

document.write('</table>')

document.write('</div>')

document.write('<div id="m1" style="position:absolute;top:'+((um1.length-1)/2*17.5+20)+';left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="#">'+um2[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um2" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

init4();

}

function init4()

{

if(um2nr < um2length){

document.write('<tr><td align="center"><a href="'+um2[um2nr3]+'">'+um2[um2nr2]+'</a></td></tr>');

um2nr++;

um2nr2=um2nr2+2;

um2nr3=um2nr3+2;

init4();

}

else{

init5();

}

}

function init5()

{

if(bw.ie6 || bw.ie4 || bw.ie5){

document.write('</table>')

document.write('</div>')

document.write('<div id="m2" style="position:absolute;top:20;left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m3_ie()">'+um3[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um3" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

else if(bw.ns4){

document.write('</table>')

document.write('</layer>')

document.write('<layer id="m2" position="absolute" top="21" left="0">')

document.write('<layer bgcolor="'+bordercolor+'" width="125">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bgcolorDark+'" width="125" position="absolute" top="1" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m3_n()">'+um3[0]+'</a></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer bgcolor="'+bordercolor+'" width="125" position="absolute" top="21" left="0">')

document.write('<table align="center">')

document.write('<tr><td align="center"></td></tr>')

document.write('</table>')

document.write('</layer>')

document.write('<layer id="um3" position="absolute" top="22" left="0" bgcolor="'+bgcolorLight+'" width="125">')

document.write('<table align="center">')

}

else if(bw.ns5){

document.write('<tr><td align="center"><a href="'+um1[24]+'">'+um1[23]+'</a></td></tr>');

document.write('</table>')

document.write('</div>')

document.write('<div id="m1" style="position:absolute;top:18;left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="javascript:do_m2_n6()">'+um2[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um2" style="position:absolute;top:18;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

else{

document.write('</table>')

document.write('</div>')

document.write('<div id="m2" style="position:absolute;top:'+((um2.length-1)/2*17.5+20)+';left:0">')

document.write('<div style="background-color:'+bgcolorDark+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127">')

document.write('<table align="center">')

document.write('<tr><td align="center"><a href="#">'+um3[0]+'</a></td></tr>')

document.write('</table>')

document.write('</div>')

document.write('<div id="um3" style="position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';width:127;border-bottom-width:0px">')

document.write('<table align="center">')

}

init6();

}

function init6()

{

if(um3nr < um3length){

document.write('<tr><td align="center"><a href="'+um3[um3nr3]+'">'+um3[um3nr2]+'</a></td></tr>');

um3nr++;

um3nr2=um3nr2+2;

um3nr3=um3nr3+2;

init6();

}

else{

init7();

}

}

function init7()

{

if(bw.ie6 || bw.ie5 || bw.ie4){

document.write('</table>')

document.write('</div>')

document.write('<div id="m3" style="height:'+((um3.length-1)/2*17.5+20+5)+';position:absolute;top:20;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';border-bottom-width:0px;width:127">')

document.write('</div></div></div></div>')

}

else if(bw.ns4){

document.write('</table>')

document.write('</layer>')

document.write('<layer id="m3" position="absolute" top="21" left="0" width="125" height="'+((um3.length-1)/2*20+20)+'" bgcolor="'+bgcolorLight+'">')

document.write('<layer bgcolor="'+bordercolor+'" width="125" height="1">')

document.write('</table></layer></table></layer></layer></layer></layer></layer>')

}

else if(bw.ns5){

document.write('</table>')

document.write('</div>')

document.write('<div id="m3" style="height:'+((um3.length-1)/2*17.5+20+5)+';position:absolute;top:18;left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';border-bottom-width:0px;width:127">')

document.write('</div></div></div></div>')

}

else{

document.write('</table>')

document.write('</div>')

document.write('<div id="m3" style="height:2;position:absolute;top:'+((um3.length-1)/2*17.5+20+5)+';left:0;background-color:'+bgcolorLight+';border-style:solid;border-width:1px;border-color:'+bordercolor+';border-bottom-width:0px;width:127">')

document.write('</div></div></div></div>')

}

}

 

var m1pos_ie=20, m1jump_ie=-5;

var m2pos_ie=20, m2jump_ie=-5;

var m3pos_ie=20, m3jump_ie=-5;

 

var m1pos_n6=18, m1jump_n6=-6;

var m2pos_n6=18, m2jump_n6=-6;

var m3pos_n6=18, m3jump_n6=-6;

 

var m1pos_n=21, m1jump_n=-5;

var m2pos_n=21, m2jump_n=-5;

var m3pos_n=21, m3jump_n=-5;

 

 

var time=5;

 

 

function do_m1_ie()

{

if(m2pos_ie>0)

{

m2jump_ie=-5;

if(m2pos_ie>=(um2.length-1)/2*17.5+20)

m2_move_ie();

}

 

if(m3pos_ie>0)

{

m3jump_ie=-5;

if(m3pos_ie>=(um3.length-1)/2*17.5+20)

m3_move_ie();

}

 

m1jump_ie=-m1jump_ie;

if(m1pos_ie<=20 || m1pos_ie>=(um1.length-1)/2*17.5+20)

m1_move_ie();

}

 

function m1_move_ie(witch)

{

document.all.m1.style.top=m1pos_ie;

m1pos_ie+=m1jump_ie;

 

if(m1pos_ie>15 && m1pos_ie<(um1.length-1)/2*17.5+20+5)

setTimeout("m1_move_ie()", time);

}

 

 

function do_m2_ie()

{

if(m1pos_ie>0)

{

m1jump_ie=-5;

if(m1pos_ie>=(um1.length-1)/2*17.5+20)

m1_move_ie();

}

 

if(m3pos_ie>0)

{

m3jump_ie=-5;

if(m3pos_ie>=(um3.length-1)/2*17.5+20)

m3_move_ie();

}

 

m2jump_ie=-m2jump_ie;

if(m2pos_ie<=20 || m2pos_ie>=(um2.length-1)/2*17.5+20)

m2_move_ie();

}

 

function m2_move_ie()

{

document.all.m2.style.top=m2pos_ie;

m2pos_ie+=m2jump_ie;

 

if(m2pos_ie>15 && m2pos_ie<(um2.length-1)/2*17.5+20+5)

setTimeout("m2_move_ie()", time);

}

 

function do_m3_ie()

{

if(m2pos_ie>0)

{

m2jump_ie=-5;

if(m2pos_ie>=(um2.length-1)/2*17.5+20)

m2_move_ie();

}

 

if(m1pos_ie>0)

{

m1jump_ie=-5;

if(m1pos_ie>=(um1.length-1)/2*17.5+20)

m1_move_ie();

}

 

m3jump_ie=-m3jump_ie;

if(m3pos_ie<=20 || m3pos_ie>=(um3.length-1)/2*17.5+20)

m3_move_ie();

}

 

function m3_move_ie()

{

document.all.m3.style.top=m3pos_ie;

m3pos_ie+=m3jump_ie;

 

if(m3pos_ie>15 && m3pos_ie<(um3.length-1)/2*17.5+20+5)

setTimeout("m3_move_ie()", time);

}

 

 

 

 

function do_m1_n()

{

if(m2pos_n>0)

{

m2jump_n=-5;

if(m2pos_n>=(um2.length-1)/2*20+20)

m2_move_n();

}

 

if(m3pos_n>0)

{

m3jump_n=-5;

if(m3pos_n>=(um3.length-1)/2*20+20)

m3_move_n();

}

 

m1jump_n=-m1jump_n;

if(m1pos_n<=21 || m1pos_n>=(um1.length-1)/2*20+20)

m1_move_n();

}

 

 

function m1_move_n()

{

document.m.document.m1.top=m1pos_n;

m1pos_n+=m1jump_n;

 

if(m1pos_n>=20 && m1pos_n<(um1.length-1)/2*20+20)

setTimeout("m1_move_n()", time);

}

 

 

function do_m2_n()

{

if(m1pos_n>0)

{

m1jump_n=-5;

if(m1pos_n>=(um1.length-1)/2*20+20)

m1_move_n();

}

 

if(m3pos_n>0)

{

m3jump_n=-5;

if(m3pos_n>=(um3.length-1)/2*20+20)

m3_move_n();

}

 

m2jump_n=-m2jump_n;

if(m2pos_n<=21 || m2pos_n>=(um2.length-1)/2*20+20)

m2_move_n();

}

 

function m2_move_n()

{

document.m.document.m1.document.m2.top=m2pos_n;

m2pos_n+=m2jump_n;

 

if(m2pos_n>20 && m2pos_n<(um2.length-1)/2*20+20)

setTimeout("m2_move_n()", time);

}

 

function do_m3_n()

{

if(m2pos_n>0)

{

m2jump_n=-5;

if(m2pos_n>=(um2.length-1)/2*20+20)

m2_move_n();

}

 

if(m1pos_n>0)

{

m1jump_n=-5;

if(m1pos_n>=(um1.length-1)/2*20+20)

m1_move_n();

}

 

m3jump_n=-m3jump_n;

if(m3pos_n<=21 || m3pos_n>=(um3.length-1)/2*20+20)

m3_move_n();

}

 

function m3_move_n()

{

document.m.document.m1.document.m2.document.m3.top=m3pos_n;

m3pos_n+=m3jump_n;

 

if(m3pos_n>20 && m3pos_n<(um3.length-1)/2*20+20)

setTimeout("m3_move_n()", time);

}

 

 

function do_m1_n6()

{

if(m2pos_n6>0)

{

m2jump_n6=-6;

if(m2pos_n6>=(um2.length-1)/2*17.5+20)

m2_move_n6();

}

 

if(m3pos_n6>0)

{

m3jump_n6=-6;

if(m3pos_n6>=(um3.length-1)/2*17.5+20)

m3_move_n6();

}

 

m1jump_n6=-m1jump_n6;

if(m1pos_n6<=18 || m1pos_n6>=(um1.length-1)/2*17.5+20)

m1_move_n6();

}

 

function m1_move_n6()

{

document.getElementById('m1').style.top=m1pos_n6;

m1pos_n6+=m1jump_n6;

 

if(m1pos_n6>15 && m1pos_n6<(um1.length-1)/2*17.5+20+5)

setTimeout("m1_move_n6()", time);

}

 

 

function do_m2_n6()

{

if(m1pos_n6>0)

{

m1jump_n6=-6;

if(m1pos_n6>=(um1.length-1)/2*17.5+20)

m1_move_n6();

}

 

if(m3pos_n6>0)

{

m3jump_n6=-6;

if(m3pos_n6>=(um3.length-1)/2*17.5+20)

m3_move_n6();

}

 

m2jump_n6=-m2jump_n6;

if(m2pos_n6<=18 || m2pos_n6>=(um2.length-1)/2*17.5+20)

m2_move_n6();

}

 

function m2_move_n6()

{

document.getElementById('m2').style.top=m2pos_n6;

m2pos_n6+=m2jump_n6;

 

if(m2pos_n6>15 && m2pos_n6<(um2.length-1)/2*17.5+20+5)

setTimeout("m2_move_n6()", time);

}

 

function do_m3_n6()

{

if(m2pos_n6>0)

{

m2jump_n6=-6;

if(m2pos_n6>=(um2.length-1)/2*17.5+20)

m2_move_n6();

}

 

if(m1pos_n6>0)

{

m1jump_n6=-6;

if(m1pos_n6>=(um1.length-1)/2*17.5+20)

m1_move_n6();

}

 

m3jump_n6=-m3jump_n6;

if(m3pos_n6<=18 || m3pos_n6>=(um3.length-1)/2*17.5+20)

m3_move_n6();

}

 

function m3_move_n6()

{

document.getElementById('m3').style.top=m3pos_n6;

m3pos_n6+=m3jump_n6;

 

if(m3pos_n6>15 && m3pos_n6<(um3.length-1)/2*17.5+20+5)

setTimeout("m3_move_n6()", time);

}

//-->

</script>

 

0 Comments

Sun

01

Mar

2009

86、鼠标下的导航链接

86、鼠标下的导航链接

脚本说明:

把如下代码加入<body>区域中:

<style>

<!--

 

.menuskin{

position:absolute;

width:165px;

background-color:menu;

border:2px solid black;

font:normal 12px Verdana;

line-height:18px;

z-index:100;

visibility:hidden;

}

 

.menuskin a{

text-decoration:none;

color:black;

padding-left:10px;

padding-right:10px;

}

 

#mouseoverstyle{

background-color:highlight;

}

 

#mouseoverstyle a{

color:white;

}

-->

</style>

 

<script language="JavaScript1.2">

 

//Pop-it menu- By Dynamic Drive

//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com

//This credit MUST stay intact for use

 

var linkset=new Array()

//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

 

 

linkset[0]='<div class="menuitems"><a href="http://www.7stk.com/">网页特效代码 </a></div>'

linkset[0]+='<div class="menuitems"><a href="http://www.7stk.com/">网页特效代码 </a></div>'

linkset[0]+='<div class="menuitems"><a href="http://www.7stk.com/">网页特效代码 </a></div>'

 

linkset[1]='<div class="menuitems"><a href="http://www.7stk.com/">MSNBC</a></div>'

linkset[1]+='<div class="menuitems"><a href="http://www.7stk.com/">网页特效代码 </a></div>'

linkset[1]+='<div class="menuitems"><a href="http://www.7stk.com/">ABC News</a></div>'

linkset[1]+='<div class="menuitems"><a href="http://www.7stk.com/">网页特效代码 </a></div>'

 

 

////No need to edit beyond here

 

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

var ns6=document.getElementById&&!document.all

var ns4=document.layers

 

function showmenu(e,which){

 

if (!document.all&&!document.getElementById&&!document.layers)

return

 

clearhidemenu()

 

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""

menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

 

if (ie4||ns6)

menuobj.innerHTML=which

else{

menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')

menuobj.document.close()

}

 

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width

menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height

eventX=ie4? event.clientX : ns6? e.clientX : e.x

eventY=ie4? event.clientY : ns6? e.clientY : e.y

 

//Find out how close the mouse is to the corner of the window

var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX

var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

 

//if the horizontal distance isn't enough to accomodate the width of the context menu

if (rightedge<menuobj.contentwidth)

//move the horizontal position of the menu to the left by it's width

menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth

else

//position the horizontal position of the menu where the mouse was clicked

menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX

 

//same concept with the vertical position

if (bottomedge<menuobj.contentheight)

menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight

else

menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY : ns6? window.pageYOffset+eventY : eventY

menuobj.thestyle.visibility="visible"

return false

}

 

function contains_ns6(a, b) {

//Determines if 1 element in contained in another- by Brainjar.com

while (b.parentNode)

if ((b = b.parentNode) == a)

return true;

return false;

}

 

function hidemenu(){

if (window.menuobj)

menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"

}

 

function dynamichide(e){

if (ie4&&!menuobj.contains(e.toElement))

hidemenu()

else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))

hidemenu()

}

 

function delayhidemenu(){

if (ie4||ns6||ns4)

delayhide=setTimeout("hidemenu()",500)

}

 

function clearhidemenu(){

if (window.delayhide)

clearTimeout(delayhide)

}

 

function highlightmenu(e,state){

if (document.all)

source_el=event.srcElement

else if (document.getElementById)

source_el=e.target

if (source_el.className=="menuitems"){

source_el.id=(state=="on")? "mouseoverstyle" : ""

}

else{

while(source_el.id!="popmenu"){

source_el=document.getElementById? source_el.parentNode : source_el.parentElement

if (source_el.className=="menuitems"){

source_el.id=(state=="on")? "mouseoverstyle" : ""

}

}

}

}

 

if (ie4||ns6)

document.onclick=hidemenu

 

</script>

<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">

</div>

<a href="#" onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">导航链接一</a><br>

<a href="#" onMouseover="showmenu(event,linkset[1])" onMouseout="delayhidemenu()">导航链接二</a>

 

1 Comments

Sun

01

Mar

2009

85、文字导航酷效果

85、文字导航酷效果

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var linktext=new Array()

linktext[0]='<table border="0" width="210" height="185" bgcolor="#EFEFEF" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>国内最大的建站类资源站点</b></font></td></tr></table>'

linktext[1]='<table border="0" width="210" height="185" bgcolor="#D1FD80" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>国内最大的也是最有名的游戏网站-第九城市</b></font></td></tr></table>'

linktext[2]='<table border="0" width="210" height="185" bgcolor="#FDB9FD" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>国内最大的新闻发布类站点-新浪网</b></font></td></tr></table>'

linktext[3]='<table border="0" width="210" height="185" bgcolor="#FFFF5E" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>国内最大的综合性娱乐站点--网易</b></font></td></tr></table>'

linktext[4]='<table border="0" width="210" height="185" bgcolor="#C2D7FC" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>最大的搜索引擎站点...搜狐</b></font></td></tr></table>'

var ns6=document.getElementById&&!document.all

var ie=document.all

function show_text(thetext, whichdiv){

if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]

else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext] }

function reset(whichdiv){

if (ie) eval("document.all."+whichdiv).innerHTML='<table border="0" width="210" height="185" bgcolor="#F88530" cellpadding="0" cellspacing="8"><tr><td valign="top"><font face="arial" size="4"><b>请把鼠标放到左侧相应的导航栏目上<p>看到变化效果了吗?</b></font></td></tr></table>'

else if (ns6) document.getElementById(whichdiv).innerHTML='<table border="0" width="210" height="185" bgcolor="#F88530" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>请把鼠标放到左侧相应的导航栏目上<p>看到变化效果了吗?</b></font></td></tr></table>'}

//  End -->

</script>

<table border="0" width="370" bgcolor="black" cellpadding="3" cellspacing="0" align="center">

<tr><td>

 

<table border="0" background="stuff/index_background.gif" width="370" cellpadding="0" cellspacing="0">

<tr><td>

 

<table border="0" width="160" bgcolor="#F88530" cellpadding="8" cellspacing="0">

<tr>

  <td onclick="window.location='http://www.7stk.com'" onmouseover="bgColor='#EFEFEF'; show_text(0,'div1')" onmouseout="bgColor='#F88530'; reset('div1')" style="cursor:pointer; cursor:hand"><font face="arial" size="4"><b>网页特效代码</b></font></td>

</tr>

<tr>

  <td onclick="window.location='http://www.7stk.com/fine/index.htm'" onMouseover="bgColor='#D1FD80'; show_text(1,'div1')" onMouseout="bgColor='#F88530'; reset('div1')" style="cursor:pointer; cursor:hand"><font face="arial" size="4"><b>精彩网页分享</b></font></td>

</tr>

<tr>

  <td onclick="window.location='http://www.7stk.com/radio/radio.htm'" onMouseover="bgColor='#FDB9FD'; show_text(2,'div1')" onMouseout="bgColor='#F88530'; reset('div1')" style="cursor:pointer; cursor:hand"><font face="arial" size="4"><b>音乐电台代码</b></font></td>

</tr>

<tr>

  <td onclick="window.location='http://www.7stk.com/music/music.htm'" onMouseover="bgColor='#FFFF5E'; show_text(3,'div1')" onMouseout="bgColor='#F88530'; reset('div1')" style="cursor:pointer; cursor:hand"><font face="arial" size="4"><b>Flash特效代码</b></font></td>

</tr>

<tr>

  <td onclick="window.location='http://www.7stk.com/flash/flash.htm'" onMouseover="bgColor='#C2D7FC'; show_text(4,'div1')" onMouseout="bgColor='#F88530'; reset('div1')" style="cursor:pointer; cursor:hand"><font face="arial" size="4"><b>音乐播放器</b></font></td>

</tr>

</table>

 

</td>

<td>

<span id="div1"><table border="0" width="210" height="185" bgcolor="#F88530" cellpadding="8" cellspacing="0"><tr><td valign="top"><font face="arial" size="4"><b>请把鼠标放到左侧相应的导航栏目上<p>看到变化效果了吗?</b></font></td></tr></table></span>

</td>

</tr>

</table>

 

</td>

</tr>

</table>

 

0 Comments

Sun

01

Mar

2009

84、可放页面左侧的导航

84、可放页面左侧的导航

脚本说明:

把如下代码加入<body>区域中

<SCRIPT>

function showitem(id,name,target)

{

       if(target==null || target.length==0)

              return ("<span class=smallFont><a href='#"+id+"' onclick='loadURL(\"" + id + "\")'>"+name+"</a></span><br>");

       else

              return ("<span class=smallFont><a target="+target+" href='"+id+"'>"+name+"</a></span><br>");

}

 

function switchoutlookBar(number)

{

       var i = outlookbar.opentitle;

       outlookbar.opentitle=number;

       var id1,id2,id1b,id2b

       if (number!=i && outlooksmoothstat==0){

       if (number!=-1)

              {

                     if (i==-1)

                            {

                            id2="blankdiv";

                            id2b="blankdiv";}

                     else{

                            id2="outlookdiv"+i;

                            id2b="outlookdivin"+i;

                            document.all("outlooktitle"+i).style.border="1px solid navy";

                            document.all("outlooktitle"+i).style.background="#4491be";

                            document.all("outlooktitle"+i).style.color="white";

                            document.all("outlooktitle"+i).style.textalign="center";

                            }

                     id1="outlookdiv"+number

                     id1b="outlookdivin"+number

                     document.all("outlooktitle"+number).style.border="1px solid navy";

                     document.all("outlooktitle"+number).style.background="TEAL";

                     document.all("outlooktitle"+number).style.color="WHITE";

                     document.all("outlooktitle"+number).style.textalign="center";

                     smoothout(id1,id2,id1b,id2b,0);

              }

       else

              {

                     document.all("blankdiv").style.display="";

                     document.all("blankdiv").sryle.height="100%";

                     document.all("outlookdiv"+i).style.display="none";

                     document.all("outlookdiv"+i).style.height="0%";

                     document.all("outlooktitle"+i).style.border="1px solid navy";

                     document.all("outlooktitle"+i).style.background="#4491be";

                     document.all("outlooktitle"+i).style.color="white";

                     document.all("outlooktitle"+i).style.textalign="center";

              }

       }

                    

}

 

function smoothout(id1,id2,id1b,id2b,stat)

{

       if(stat==0){

              tempinnertext1=document.all(id1b).innerHTML;

              tempinnertext2=document.all(id2b).innerHTML;

              document.all(id1b).innerHTML="";

              document.all(id2b).innerHTML="";

              outlooksmoothstat=1;

              document.all(id1b).style.overflow="hidden";

              document.all(id2b).style.overflow="hidden";

              document.all(id1).style.height="0%";

              document.all(id1).style.display="";

              setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);

       }

       else

       {

              stat+=outlookbar.inc;

              if (stat>100)

                     stat=100;

              document.all(id1).style.height=stat+"%";

              document.all(id2).style.height=(100-stat)+"%";

              if (stat<100)

                     setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);

              else

                     {

                     document.all(id1b).innerHTML=tempinnertext1;

                     document.all(id2b).innerHTML=tempinnertext2;

                     outlooksmoothstat=0;

                     document.all(id1b).style.overflow="auto";

                     document.all(id2).style.display="none";

                     }

       }

}

 

function getOutLine()

{

       outline="<table "+outlookbar.otherclass+">";

       for (i=0;i<(outlookbar.titlelist.length);i++)

              {

                     outline+="<tr><td name=outlooktitle"+i+" id=outlooktitle"+i+" ";          

                     if (i!=outlookbar.opentitle)

                            outline+=" nowrap align=center style='cursor:hand;background-color:#4491be;color:white;height:5;border:1 solid navy' ";

                     else

                            outline+=" nowrap align=center style='cursor:hand;background-color:#4491be;color:#6666b3;height:5;border:1 solid white' ";

                     outline+=outlookbar.titlelist[i].otherclass

                     outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont><b>";

                     outline+=outlookbar.titlelist[i].title+"</b></span></td></tr>";

                     outline+="<tr><td name=outlookdiv"+i+" valign=top align=center  id=outlookdiv"+i+" style='width:100%"

                     if (i!=outlookbar.opentitle)

                            outline+=";display:none;height:0%;";

                     else

                            outline+=";display:;height:100%;";

                     outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:100%;height:100%'>";

                     outline+="<table " + outlookbar.currentclass + ">";

                     for (j=0;j<outlookbar.itemlist[i].length;j++) {

                            outline += "<tr><td align=center>"

                            outline+=showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title,outlookbar.itemlist[i][j].target);

                     }

                     outline+="</table>"

                     outline+="</div></td></tr>"

              }

       outline+="<tr><td name=blankdiv valign=top align=center  id=blankdiv style='height:100%;width:100%:"

       if (outlookbar.opentitle!=-1)

                            outline+=";display:none;";

                     else

                            outline+=";display:;";

       outline+="'><div style='overflow:auto;width:100%;height:100%'>";

       outline+="</div></td></tr>"

      

       outline+="</table>"

       return outline

 

}

 

function show()

{

       var outline;

       outline="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"

       outline+=outlookbar.getOutLine();

       outline+="</div>"

       document.write(outline);

}

 

function theitem(intitle,instate,inkey, target)

{

       this.state=instate;

       this.otherclass=" nowrap ";

       this.key=inkey;

       this.title=intitle;

       this.target=target;

}

 

function addtitle(intitle)

{

       outlookbar.itemlist[outlookbar.titlelist.length]=new Array();

       outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);

       if (outlookbar.titlelist.length != (outlookbar.starttitle+1))

              outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#6666b3;color:white;height:5;border:1 solid navy' ";

       else

              outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#C1E0FF;color:#6666b3;height:5;border:1 solid white' ";

       return(outlookbar.titlelist.length-1);

}

 

function additem(intitle,parentid,inkey,target)

{

       if (parentid>=0 && parentid<=outlookbar.titlelist.length)

       {

              outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey,target);

              outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='backgroundColor:blue;height:5' ";

              return(outlookbar.itemlist[parentid].length-1);

       }

       else

              additem=-1;

}

 

function outlook()

{

       this.titlelist=new Array();

       this.itemlist=new Array();

       this.divstyle="style='height:100%;width:100%;overflow:auto' align=center";

       this.otherclass="border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";

       this.currentclass="border=0 cellspacing='0' cellpadding='4' style='width:100%'valign=middle align=center ";

       this.addtitle=addtitle;

       this.additem=additem;

       this.starttitle=-1;

       this.show=show;

       this.getOutLine=getOutLine;

       this.opentitle=this.starttitle;

       this.reflesh=outreflesh;

       this.timedelay=50;

       this.inc=10;

      

}

 

function outreflesh()

{

       document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();

}

 

function locatefold(foldname)

{

       for (var i=0;i<outlookbar.titlelist.length;i++)

              if(foldname==outlookbar.titlelist[i].title)

                     {

                             outlookbar.starttitle=i;

                             outlookbar.opentitle=i;

                     }

}

var outlookbar=new outlook();

var tempinnertext1,tempinnertext2,outlooksmoothstat

outlooksmoothstat = 0;

function loadURL(url) {

window.parent.mainFrame.location = url;

}

 

</SCRIPT>

<TABLE height=100% width=150>

<TR>

       <TD>

<SCRIPT>

var t;

t=outlookbar.addtitle('常用代码')

outlookbar.additem('城市三字代码', t, 'forum.jsp?forum=107')

outlookbar.additem('航空公司代码', t, 'forum.jsp?forum=106')

 

t=outlookbar.addtitle('机票信息')

//outlookbar.additem('报表浏览', t, 'report/CReportdetail.asp')

outlookbar.additem('国际机票价格', t, 'search.jsp?forum=34')

outlookbar.additem('国际机票价格<br>(附件)', t, 'search.jsp?forum=35')

outlookbar.additem('国内机票价格', t, 'forum.jsp?forum=109')

outlookbar.additem('级别管理',t, 'ClassGroupCreate.jsp')

 

t=outlookbar.addtitle('航班查询')

outlookbar.additem('国内航班查询', t, 'forum.jsp?forum=108')

 

t=outlookbar.addtitle('酒店信息')

outlookbar.additem('酒店价格', t, 'forum.jsp?forum=137')

 

t=outlookbar.addtitle('其他信息')

outlookbar.additem('联系人', t, 'forum.jsp?forum=166')

outlookbar.additem('产品发布', t, 'forum.jsp?forum=36')

outlookbar.additem('其它产品<br>(签证等)', t, 'forum.jsp?forum=151')

 

t=outlookbar.addtitle('客户服务')

outlookbar.additem('客户服务园地', t, 'forum.jsp?forum=121')

outlookbar.additem('问题反馈', t, 'forum.jsp?forum=136')

 

t=outlookbar.addtitle('各类表格')

outlookbar.additem('Worldspan申请表', t, 'worldspan.jsp', "_blank")

                           

 

outlookbar.show()

switchoutlookBar(1)

</SCRIPT></TD>

</TR>

</TABLE>

 

 

0 Comments

Sun

01

Mar

2009

83、导航的文字图片说明

83、导航的文字图片说明

脚本说明:

把如下代码加入<body>区域中

<script language="javascript" type="text/javascript">

<!--

 

var dom = (document.getElementById) ? true : false;

var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;

var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;

var ns4 = (document.layers && !dom) ? true : false;

var ie4 = (document.all && !dom) ? true : false;

var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

 

// resize fix for ns4

var origWidth, origHeight;

if (ns4) {

       origWidth = window.innerWidth; origHeight = window.innerHeight;

       window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }

}

 

// avoid error of passing event object in older browsers

if (nodyn) { event = "nope" }

 

 

///////////////////////  CUSTOMIZE HERE   ////////////////////

// settings for tooltip

// Do you want tip to move when mouse moves over link?

var tipFollowMouse= true;   

var tipWidth= 160;

var offX= 12; // how far from mouse to show tip

var offY= 12;

var tipFontFamily= "Verdana, arial, helvetica, sans-serif";

var tipFontSize= "8pt";

var tipFontColor= "#000000";

var tipBgColor= "#DDECFF";

var origBgColor= tipBgColor; // in case no bgColor set in array

var tipBorderColor= "#000080";

var tipBorderWidth= 3;

var tipBorderStyle= "ridge";

var tipPadding= 4;

 

// preload images that are to appear in tooltip, (width,height)

var img1 = new Image(106,131);  img1.src = "1601.gif";

var img2 = new Image(90,45);            img2.src = "1602.gif";

 

// tooltip content goes here

var messages = new Array();

// multi-dimensional arrays containing

// image, text, bgColor to be sent to tooltip

messages[0] = new Array('1601.gif','链接一的说明文字',"#FFFFFF");

messages[1] = new Array('1602.gif','链接二的说明文字',"#DDECFF");

messages[2] = new Array('','','');

 

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

 

// to layout image and text, 2-row table, image centered in top cell

// these go in var tip in doTooltip function

// startStr goes before image, midStr goes between image and text

var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';

var midStr = '" border="0"></td></tr><tr><td valign="top">';

var endStr = '</td></tr></table>';

 

////////////////////////////////////////////////////////////

//  initTip      - initialization for tooltip.

//            Global variables for tooltip.

//            Set styles for all but ns4.

//            Set up mousemove capture if tipFollowMouse set true.

////////////////////////////////////////////////////////////

var tooltip, tipcss;

function initTip() {

       if (nodyn) return;

       tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;

       tipcss = (ns4)? document.tipDiv: tooltip.style;

       if (ie4||ie5||ns5) {   // ns4 would lose all this on rewrites

              tipcss.width = tipWidth+"px";

              tipcss.fontFamily = tipFontFamily;

              tipcss.fontSize = tipFontSize;

              tipcss.color = tipFontColor;

              tipcss.backgroundColor = tipBgColor;

              tipcss.borderColor = tipBorderColor;

              tipcss.borderWidth = tipBorderWidth+"px";

              tipcss.padding = tipPadding+"px";

              tipcss.borderStyle = tipBorderStyle;

       }

       if (tooltip&&tipFollowMouse) {

              if (ns4) document.captureEvents(Event.MOUSEMOVE);

              document.onmousemove = trackMouse;

       }

}

 

window.onload = initTip;

 

/////////////////////////////////////////////////

//  doTooltip function

//                   Assembles content for tooltip and writes

//                   it to tipDiv

/////////////////////////////////////////////////

var t1,t2; // for setTimeouts

var tipOn = false;   // check if over tooltip link

function doTooltip(evt,num) {

       if (!tooltip) return;

       if (t1) clearTimeout(t1); if (t2) clearTimeout(t2);

       tipOn = true;

       if (ns4) {

              if (messages[num][2])    tipBgColor = messages[num][2];

              else tipBgColor = origBgColor;

              var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + tipBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + tipFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';

              tooltip.write(tip);

              tooltip.close();

       } else if (ie4||ie5||ns5) {

              var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + tipFontColor + ';">' + messages[num][1] + '</span>' + endStr;

              tipcss.backgroundColor = messages[num][2];

             tooltip.innerHTML = tip;

       }

       if (!tipFollowMouse) positionTip(evt);

       else t1=setTimeout("tipcss.visibility='visible'",100);

}

 

var mouseX, mouseY;

function trackMouse(evt) {

       mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;

       mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;

       if (tipOn) positionTip(evt);

}

 

/////////////////////////////////////////////////////////////

//  positionTip function

//            If tipFollowMouse set false, so trackMouse function

//            not being used, get position of mouseover event.

//            Calculations use mouseover event position,

//            offset amounts and tooltip width to position

//            tooltip within window.

/////////////////////////////////////////////////////////////

function positionTip(evt) {

       if (!tipFollowMouse) {

              mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;

              mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;

       }

       // tooltip width and height

       var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;

       var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;

       // document area in view (subtract scrollbar width for ns)

       var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;

       var winHt = (ns4||ns5)? window.innerHeight+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;

       // check mouse position against tip and window dimensions

       // and position the tooltip

       if ((mouseX+offX+tpWd)>winWd)

              tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";

       else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";

       if ((mouseY+offY+tpHt)>winHt)

              tipcss.top = (ns4)? mouseY-(tpHt+offY): mouseY-(tpHt+offY)+"px";

       else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";

       if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);

}

 

function hideTip() {

       if (!tooltip) return;

//     tipcss.visibility = "hidden";

       t2=setTimeout("tipcss.visibility='hidden'",100);

       tipOn = false;

}

//-->

</script>

<a href="http://www.7stk.com/" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">网页特效代码</a><br>

<a href=" http://www.7stk.com/fine/index.htm" onmouseover="doTooltip(event,1)" onmouseout="hideTip()">精彩网页分享</a>

<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>

 

 

0 Comments

Sun

01

Mar

2009

82、数字导航效果

82、数字导航效果

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var phone_num='';

var timerID = null;

var timerRunning = false;

function but1()

{

 

phone_num = phone_num + '1';

 chknum();

}

function but2()

{

 phone_num = phone_num + '2';

 chknum();

}

function but3()

{

 phone_num = phone_num + '3';

 chknum();

}

function but4()

{

 phone_num = phone_num + '4';

 chknum();

}

function but5()

{

 phone_num = phone_num + '5';

 chknum();

}

function but6()

{

 phone_num = phone_num + '6';

 chknum();

}

function but7()

{

 phone_num = phone_num + '7';

 chknum();

}

function but8()

{

 phone_num = phone_num + '8';

 chknum();

}

function but9()

{

 phone_num = phone_num + '9';

 chknum();

}

function but0()

{

 phone_num = phone_num + '0';

 chknum();

}

function chknum()

{

 

//ADD YOUR NUMBERS AND URLS HERE

 

if (phone_num=="01")

 document.location="http://www.7stk.com";

 

if (phone_num=="123")

 

 document.location="http://www.cctv.com";

 

 if (phone_num=="1245")

 

 document.location="http://www.163.com";

 

document.board.pn.value=phone_num;

}

function clearit()

{

 phone_num = "";

 document.board.pn.value=phone_num;

}

//  End -->

</script>

 

<h2>01= www.7stk.com & 123= www.cctv.com</h2>

<form name="board">

<center>

<table BORDER CELLSPACING=0 CELLPADDING=0 COLS=3 WIDTH="135" BGCOLOR="#FF0000" >

<tr ALIGN=CENTER>

<td><input type=button value="    1    "onClick="but1(); window.focus()"></td>

 

<td><input type=button value="    2    "onClick="but2(); window.focus()"></td>

 

<td><input type=button value="    3    "onClick="but3(); window.focus()"></td>

</tr>

 

<tr ALIGN=CENTER>

<td><input type=button value="    4    "onClick="but4(); window.focus()"></td>

 

<td><input type=button value="    5    "onClick="but5(); window.focus()"></td>

 

<td><input type=button value="    6    "onClick="but6(); window.focus()"></td>

</tr>

 

<tr ALIGN=CENTER>

<td><input type=button value="    7    "onClick="but7(); window.focus()"></td>

 

<td><input type=button value="    8    "onClick="but8(); window.focus()"></td>

 

<td><input type=button value="    9    "onClick="but9(); window.focus()"></td>

</tr>

 

<tr ALIGN=CENTER>

<td COLSPAN="3">

<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="100%" >

<tr>

<td ALIGN=CENTER WIDTH="50%"><input type=button value="    0    "onClick="but0(); window.focus()"></td>

 

<td ALIGN=CENTER WIDTH="50%"><input type=button value="Reset"onClick="clearit(); window.focus()"></td>

</tr>

</table></center>

</td>

</tr>

 

<tr>

<td ALIGN=CENTER COLSPAN="3"><input type=text name=pn size="10"></td>

</tr>

</table></center>

 

<center></form>

0 Comments

Sun

01

Mar

2009

81、随机出现很酷的公告栏

81、随机出现很酷的公告栏

<script LANGUAGE="JavaScript1.1">

<!-- JavaScript &#49884;&#51089;-

 

messages = new Array()

messages[0] = "这个公告栏式不是非常漂亮?"

messages[1] = "您可以修改本程序并且应用在您的主页上面。"

messages[2] = "但是任何情况下不能用在商业目的!"

messages[3] = "写点什么好呢?。。。。。。"

messages[4] = "我的主页地址是 http://www.xinnew.com"

messages[5] = "是不是非常好记?"

messages[6] = "e-mail tatty@263.net"

messages[7] = " spook-office的缩写?·#·¥%%"

messages[8] = "还写什么好呢? ..."

messages[9] = "写一写我吧! 我实在是没的写了~~"

messages[10] = "我叫tatty"

messages[11] = "80n年代的产品拉"

messages[12] = "现在当然就是在上海拉"

messages[13] = "你也喜欢javascript吧??"

messages[14] = "我是为了学习才做站的~"

messages[15] = "如果你是高手,请多多指教。"

messages[16] = "建此站的另一个目的还是为了造福自己"

messages[17] = "就是自己需要时可以自给自足嘛"

messages[18] = "你们还可以去去我们班的主页"

messages[19] = "也是我做的,但当时是命令,不敢不从"

messages[20] = "现在已经很少去更新了,所以……"

messages[21] = "希望您以后能一如既往的支持本站的发展"

 

mescolor = new Array()

mescolor[0] = "000000"

mescolor[1] = "FF0000"

mescolor[2] = "226622"

mescolor[3] = "0000FF"

mescolor[4] = "FFFF00"

 

textfont = new Array()

textfont[0] = "Verdana"

textfont[1] = "Times"

textfont[2] = "Arial"

 

bagcolor = new Array()

bagcolor[0] = "CCCCCC"

bagcolor[1] = "Yellow"

bagcolor[2] = "CCFFFF"

bagcolor[3] = "AAEEFF"

bagcolor[4] = "CCFF88"

bagcolor[5] = "orange"

bagcolor[6] = "99AAFF"

 

var i_messages = 0

var timer

 

function randomposition(range) {       

       return Math.floor(range*Math.random())

}

 

function dotransition() {

    if (document.all) {

        content.filters[i_messages].apply()

        content.innerHTML = "<table width=320 height=180 border=2><tr><td bgcolor="+bagcolor[randomposition(6)]+" style='color:"+mescolor[randomposition(4)]+";font-family:"+textfont[randomposition(2)]+";font-size:30px' align=center valign=middle>"+messages[i_messages]+"</td></tr></table>"

        content.filters[i_messages].play()

        if (i_messages >= messages.length-1) {

            i_messages = 0

        }

        else {

            i_messages++

        }

    }

    timer = setTimeout("dotransition()",3000)  

}

 

// - JavaScript &#45149;- -->

</script>

0 Comments

Sun

01

Mar

2009

80、随机的图片导航

80、随机的图片导航

脚本说明:

把如下代码加入<body>区域中

<script>

var banner_link=new Array();

banner_link[0]="http://www.7stk.com";

banner_link[1]="http://www.7stk.com";

banner_link[2]="http://www.7stk.com";

banner_link[3]="http://www.7stk.com";

 

var banner_alt=new Array();

banner_alt[0]="网页特效代码";

banner_alt[1]="网页特效代码";

banner_alt[2]="网页特效代码";

banner_alt[3]="网页特效代码";

 

var n=Math.floor(Math.random()*banner_link.length)

var c=(n<10?'0':'')+(n+1);

 

document.writeln("<a href="+banner_link[n]+" target=_blank><img src=banner_"+c+".gif border=0 width=468 height=60 alt="+banner_alt[n]+"></a>");

</script>

 

1 Comments

Sun

01

Mar

2009

79、可隐藏的导航表格

79、可隐藏的导航表格

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

<!--

td { font-size: 12px; line-height: 150%}

-->

</style>

<script language="JavaScript">

<!--

 

function hve_display(t_id,i_id){//显示隐藏程序

var t_id;//表格ID

var i_id;//图片ID

var on_img="2308.gif";//打开时图片

var off_img="2305.gif";//隐藏时图片

if (t_id.style.display == "none") {//如果为隐藏状态

t_id.style.display="";//切换为显示状态

i_id.src=on_img;}//换图

else{//否则

t_id.style.display="none";//切换为隐藏状态

i_id.src=off_img;}//换图

}

 

//-->

</script>

<table width="500">

<tr>

<td>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img1" onClick="hve_display(table1,img1)" style="cursor: hand"></td></tr>

<!--图片的IDimg1,要隐藏的表格IDtable1onclick调用hve_display程序;style设置鼠标为手型。-->

</table>

<table ID="table1" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

 

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img2" onClick="hve_display(table2,img2)" style="cursor: hand"></td>

</tr>

</table>

<table id="table2" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img3" onClick="hve_display(table3,img3)" style="cursor: hand"></td>

</tr>

</table>

<table id="table3" width="201" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

<br>

<table width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699">

<tr bgcolor="#006699">

<td> </td>

<td width="20"><img src="2308.gif" width="17" height="14" name="img4" onClick="hve_display(table4,img4)" style="cursor: hand"></td>

</tr>

</table>

<table id="table4" width="200" border="0" cellspacing="1" cellpadding="0" bgcolor="#006699" height="120">

<tr bgcolor="#FFFFFF">

<td bgcolor="#7AACFE">  </td>

</tr>

</table>

</td>

</tr>

</table>

 

 

0 Comments

Sun

01

Mar

2009

78、QQ之类的树型菜单

78QQ之类的树型菜单

1   把如下代码复制到<head></head>之间

 

 

<script>

if (!document.getElementById)

    document.getElementById = function() { return null; }

 

function initializeMenu(menuId, actuatorId) {

    var menu = document.getElementById(menuId);

    var actuator = document.getElementById(actuatorId);

 

    if (menu == null || actuator == null) return;

 

    //if (window.opera) return; // I'm too tired

 

    actuator.parentNode.style.backgroundImage = "url(/images/plus.gif)";

    actuator.onclick = function() {

        var display = menu.style.display;

        this.parentNode.style.backgroundImage =

            (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";

        menu.style.display = (display == "block") ? "none" : "block";

 

        return false;

    }

}

 window.onload = function() {

            initializeMenu("productsMenu", "productsActuator");

            initializeMenu("newPhonesMenu", "newPhonesActuator");

            initializeMenu("compareMenu", "compareActuator");

        }

</script>

<style>

body {

  font-family: verdana, helvetica, arial, sans-serif;

}

 

#mainMenu {

  background-color: #EEE;

  border: 1px solid #CCC;

  color: #000;

  width: 203px;

}

 

#menuList {

  margin: 0px;

  padding: 10px 0px 10px 15px;

}

 

li.menubar {

  background: url(/images/plus.gif) no-repeat 0em 0.3em;

  font-size: 12px;

  line-height: 1.5em;

  list-style: none outside;

}

 

.menu, .submenu {

  display: none;

  margin-left: 15px;

  padding: 0px;

}

 

.menu li, .submenu li {

  background: url(/images/square.gif) no-repeat 0em 0.3em;

  list-style: none outside;

}

 

a.actuator {

  background-color: transparent;

  color: #000;

  font-size: 12px;

  padding-left: 15px;

  text-decoration: none;

}

 

a.actuator:hover {

  text-decoration: underline;

}

 

.menu li a, .submenu li a {

  background-color: transparent;

  color: #000;

  font-size: 12px;

  padding-left: 15px;

  text-decoration: none;

}

 

.menu li a:hover, submenu li a:hover {

  /*border-bottom: 1px dashed #000;*/

  text-decoration: underline;

}

 

span.key {

  text-decoration: underline;

}

</style>

 

 

 

2    把如下代码复制到<body></body>之间

 

 

 

 

<div id="mainMenu">

      <ul id="menuList">

        <li class="menubar">

          <a href="#" id="productsActuator" class="actuator">网页特效集锦</a>

          <ul id="productsMenu" class="menu">

            <li>

              <a href="#" id="newPhonesActuator" class="actuator">栏目导航</a>

              <ul id="newPhonesMenu" class="submenu">

                <li><a href="http://7stk.com/background/index.htm" target="_balcn">背景按钮特效</a></li>

                <li><a href="http://7stk.com/moban/index.htm" target="_balcn">网页模板</a></li>

                <li><a href="http://7stk.com/navigation/index.htm" target="_balcn">导航菜单特效</a></li>

                <li><a href="http://7stk.com/img/index.htm" target="_balcn">图像特效</a></li>

              </ul>

            </li>

            <li>

              <a href="#" id="compareActuator" class="actuator">栏目导航</a>

              <ul id="compareMenu" class="submenu">

                <li><a href="http://7stk.com/text/index.htm" target="_balcn">文本特效</a></li>

                <li><a href="http://7stk.com/time/index.htm" target="_balcn">时间日期特效</a></li>

                <li><a href="http://7stk.com/state/index.htm" target="_balcn">状态栏特效</a></li>

                <li><a href="http://7stk.com/other/index.htm" target="_balcn">另类网页特效</a></li>

              </ul>

            </li>

          </ul>

        </li>

      </ul>

    </div>

 

0 Comments

Sun

01

Mar

2009

77、简洁的双级导航菜单

77、简洁的双级导航菜单

1   把如下代码复制到<head></head>之间

 

<script language="javascript">

// JavaScript Document

 

startList = function() {

if (document.all&&document.getElementById) {

navRoot = document.getElementById("nav");

for (i=0; i<navRoot.childNodes.length; i++) {

node = navRoot.childNodes[i];

if (node.nodeName=="LI") {

node.onmouseover=function() {

this.className+=" over";

 }

 node.onmouseout=function() {

 this.className=this.className.replace(" over", "");

 }

 }

 }

 }

}

window.onload=startList;

</script>

<style type="text/css">

<!--

body {

  font: normal 11px verdana;

  }

 

ul {

  margin: 0;

  padding: 0;

  list-style: none;

  width: 150px; /* Width of Menu Items */

  border-bottom: 1px solid #CCC;

  }

 

ul li {

  position: relative;

  }

 

li ul {

  position: absolute;

  left: 149px; /* Set 1px less than menu width */

  top: 0;

  display: none;

  }

 

/* Styles for Menu Items */

ul li a {

  display: block;

  text-decoration: none;

  color: #777;

  background: #fff; /* IE6 Bug */

  padding: 5px;

  border: 1px solid #ccc; /* IE6 Bug */

  border-bottom: 0;

  }

 

/* Holly Hack. IE Requirement \*/

* html ul li { float: left; height: 1%; }

* html ul li a { height: 1%; }

/* End */

 

li:hover ul, li.over ul { display: block; } /* The magic */

-->

</style>

 

 

2     把如下代码复制到<body></body>之间

 

 

 

 

<ul id="nav">

 <li><a href="#">Home</a></li>

 <li><a href="#">About</a>

 <ul>

 <li><a href="#">History</a></li>

 <li><a href="#">Team</a></li>

 <li><a href="#">Offices</a></li>

 </ul>

 </li>

 <li><a href="#">Services</a>

 <ul>

 <li><a href="#">Web Design</a></li>

 <li><a href="#">Internet Marketing</a></li>

 <li><a href="#">Hosting</a></li>

 <li><a href="#">Domain Names</a></li>

 <li><a href="#">Broadband</a></li>

 </ul>

 </li>

 <li><a href="#">Contact Us</a>

 <ul>

 <li><a href="#">United Kingdom</a></li>

 <li><a href="#">France</a></li>

 <li><a href="#">USA</a></li>

 <li><a href="#">Australia</a></li>

 </ul>

 </li>

</ul>

 

0 Comments

Sun

01

Mar

2009

76、拖动的超酷菜单

76、拖动的超酷菜单

脚本说明:

把如下代码加入<body>区域中

<style>

body,td,a {font-size:9pt;color:black}

.none{border:black 1px solid;background:D9D9D9;padding-top:2}

.over {border:black 1px solid;background:707888;color:white;padding-top:2}

</style>

<body onmousemove="move()">

<div style="position:absolute; left: 100; top: 100; width: 1; height: 1;cursor: hand" ID=plane onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);divtop=event.clientY-parseInt(plane.style.top)"onmouseup="down=false">

<div align=center style="position:absolute; left:150px; top:33px; width:100px; height:19px; z-index:1;color:white;background:707888;cursor:move"onmouseover='stopTimerline();menuItemIn()' onmouseout='runTimerline()' class="none">可拖动的菜单</div>

<div align=center id="item11" style="position:absolute; left:50px; top:55px; width:99px; height:19px; z-index:2; filter:alpha(opacity=0)" onmouseover="this.className='over';stopTimerline()"

onmouseout="this.className='none';runTimerline()" class="none"

><a href="http://www.7stk.com/">网页特效代码</a></div>

<div align=center id="item12" style="position:absolute; left:250px; top:77px; width:99px; height:19px; z-index:3;filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';stopTimerline()"

onmouseout="this.className='none';runTimerline()">菜单项二</div>  <div align=center id="item13" style="position:absolute; left:50px; top:99px; width:99px; height:19px; z-index:4; filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';stopTimerline()"

onmouseout="this.className='none';runTimerline()">菜单项三</div>

<div align=center id="item14" style="position:absolute; left:250px; top:121px; width:99px; height:19px; z-index:5;filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';stopTimerline()"

onmouseout="this.className='none';runTimerline()">菜单项四</div>  <div align=center id="item15" style="position:absolute; left:50px; top:143px; width:99px; height:19px; z-index:6; filter:alpha(opacity=0)"

class=none onmouseover="this.className='over';stopTimerline()"

onmouseout="this.className='none';runTimerline()">菜单项五</div>

</div><script>

//动画菜单

var currTimerlinePoint=0

var totalTimerlineFrames=2

var timerlineTimer

var leftLine = 50

var timerIn

var timerOut

var timerlineArray = new Array()

timerlineArray[0]=''

timerlineArray[1]='menuItemOut()'

function runTimerline()

{

window.timerlineTimer = setTimeout('menuItemOut()',500)

}

function stopTimerline()

{

clearTimeout(window.timerlineTimer)

}

function menuItemIn()

{

if( leftLine != 150)

{

item11.style.pixelLeft += 20; item11.filters.alpha.opacity += 20

item12.style.pixelLeft -= 20; item12.filters.alpha.opacity += 20

item13.style.pixelLeft += 20; item13.filters.alpha.opacity += 20

item14.style.pixelLeft -= 20; item14.filters.alpha.opacity += 20

item15.style.pixelLeft += 20; item15.filters.alpha.opacity += 20

leftLine += 20

}

else

{

clearTimeout(window.timerIn)

return false

}

timerIn=window.setTimeout('menuItemIn()',1)

}

function menuItemOut()

{

clearTimeout(window.timerIn)

if (leftLine != 50)

{

item11.style.pixelLeft -= 20; item11.filters.alpha.opacity -= 20

item12.style.pixelLeft += 20; item12.filters.alpha.opacity -= 20

item13.style.pixelLeft -= 20; item13.filters.alpha.opacity -= 20

item14.style.pixelLeft += 20; item14.filters.alpha.opacity -= 20

item15.style.pixelLeft -= 20; item15.filters.alpha.opacity -= 20

leftLine -= 20

}

else

{

clearTimeout(window.timerOut)

return false;

}

timerOut=window.setTimeout("menuItemOut()",1)

}

//移动层

var over=false,down=false,divleft,divtop;function move(){if(down){plane.style.left=event.clientX-divleft;plane.style.top=event.clientY-divtop}}

</script>

 

 

0 Comments

Sun

01

Mar

2009

75、多层超酷导航条

75、多层超酷导航条

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

A:link,A:visited{COLOR: #000000;TEXT-DECORATION: none}

A:hover{COLOR:#6B9636;TEXT-DECORATION: underline}

td{font-size:9pt}

.a_mo{position:absolute;width:80px;left:30px;background-color: #F7F7E7;z-index:1;border: 1px none #6B9636;visibility: hidden}

</style>

<script language="javascript">

a_mo4=10 //注意这里的10是指子菜单里的内容多少,10个却为有9个子菜单

function displaymainmenu(){mainmenu.style.visibility="visible";}

function hidemainmenu(){mainmenu.style.visibility="hidden";

for(i=1;i<a_mo4;i++)

eval('sonmenu'+i+'.style.visibility="hidden"')}

function displaysonmenu(n){

for(i=1;i<a_mo4;i++)

eval('sonmenu'+i+'.style.visibility="hidden"');

x=eval(n);x.style.visibility="visible";}

function hidesonmenu(n){mainmenu.style.visibility="hidden";

for(i=1;i<a_mo4;i++)eval('sonmenu'+i+'.style.visibility="hidden"')}

</script>

<div id="menu" style="display:" onmouseover="javascript:displaymainmenu()" align="center">

<div id="mainmenu" onmouseout="hidemainmenu()" style="position:absolute;width:90px;background-color: #F7F7E7;z-index:1;border: 1px none #6B9636;visibility: hidden">

<table width="100%" height=100% gcolor="#F7F7E7" cellspacing="0" cellpadding="0" border=2 bordercolor="#6B9636"><tr><td><center><a href="main.php">建站资源</a></center>

<table width="90%" border="1" cellspacing="0" cellpadding="2" align="center" bgcolor="#F7F7E7" bordercolor="#6B9636"><tr><td>

 

<div id="menuLayer1" style="display:" onmouseover="javascript:displaysonmenu('sonmenu1')">

<a href="layer.php?layer=投资与理财>">投资与理财</a>

<div id="sonmenu1" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bordercolor="#6B9636">

<tr><td><a href="http://www.7stk.com/">家庭理财</a></td></tr>

<tr><td><a href="http://www.7stk.com/">股票证券</a></td></tr>

<tr><td><a href="http://www.7stk.com/">保险</a></td></tr>

<tr><td><a href="http://www.7stk.com/">求职与招聘</a></td></tr>

<tr><td><a href="http://www.7stk.com/">政策法律</a></td></tr>

<tr><td><a href="http://www.7stk.com/">二手交易</a></td></tr>

<tr><td><a href="http://www.7stk.com/">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer2" style="display:" onmouseover="javascript:displaysonmenu('sonmenu2')"><a href="layer.php?layer=娱乐休闲>">娱乐休闲</a>

<div id="sonmenu2" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="http://www.7stk.com/">酷站</a></td></tr>

<tr><td><a href="http://www.7stk.com/">游戏</a></td></tr>

<tr><td><a href="http://www.7stk.com/">旅游</a></td></tr>

<tr><td><a href="http://www.7stk.com/">体育运动</a></td></tr>

<tr><td><a href="http://www.7stk.com/">影视</a></td></tr>

<tr><td><a href="http://www.7stk.com/">歌曲与音乐</a></td></tr>

<tr><td><a href="http://www.7stk.com/">美食</a></td></tr>

<tr><td><a href="http://www.7stk.com/">动漫</a></td></tr>

<tr><td><a href="http://www.7stk.com/">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer3" style="display:" onmouseover="javascript:displaysonmenu('sonmenu3')"><a href="layer.php?layer=计算机>">计算机</a>

<div id="sonmenu3" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#计算机>WINDOWS">WINDOWS</a></td></tr>

<tr><td><a href="#计算机>编程">编程</a></td></tr>

<tr><td><a href="#计算机>互联网">互联网</a></td></tr>

<tr><td><a href="#计算机>上网技巧">上网技巧</a></td></tr>

<tr><td><a href="#计算机>硬件">硬件</a></td></tr>

<tr><td><a href="#计算机>操作系统">操作系统</a></td></tr>

<tr><td><a href="#计算机>应用软件">应用软件</a></td></tr>

<tr><td><a href="#计算机>图像处理">图像处理</a></td></tr>

<tr><td><a href="#计算机>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer4" style="display:" onmouseover="javascript:displaysonmenu('sonmenu4')"><a href="layer.php?layer=健康医药>">健康医药</a>

<div id="sonmenu4" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#健康医药>养生保健">养生保健</a></td></tr>

<tr><td><a href="#健康医药>性保健">性保健</a></td></tr>

<tr><td><a href="#健康医药>心理健康">心理健康</a></td></tr>

<tr><td><a href="#健康医药>医药">医药</a></td></tr>

<tr><td><a href="#健康医药>小毛小病">小毛小病</a></td></tr>

<tr><td><a href="#健康医药>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer5" style="display:" onmouseover="javascript:displaysonmenu('sonmenu5')"><a href="layer.php?layer=生活>">生活</a>

<div id="sonmenu5" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#生活>住房">住房</a></td></tr>

<tr><td><a href="#生活>购物">购物</a></td></tr>

<tr><td><a href="#生活>交通">交通</a></td></tr>

<tr><td><a href="#生活>烹饪">烹饪</a></td></tr>

<tr><td><a href="#生活>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer6" style="display:" onmouseover="javascript:displaysonmenu('sonmenu6')"><a href="layer.php?layer=女性世界>">女性世界</a>

<div id="sonmenu6" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#女性世界>美容">美容</a></td></tr>

<tr><td><a href="#女性世界>膳食保养">膳食保养</a></td></tr>

<tr><td><a href="#女性世界>时尚">时尚</a></td></tr>

<tr><td><a href="#女性世界>情感世界">情感世界</a></td></tr>

<tr><td><a href="#女性世界>职业男女">职业男女</a></td></tr>

<tr><td><a href="#女性世界>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer7" style="display:" onmouseover="javascript:displaysonmenu('sonmenu7')"><a href="layer.php?layer=家庭>">家庭</a>

<div id="sonmenu7" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#家庭>布置与装修">布置与装修</a></td></tr>

<tr><td><a href="#家庭>育儿">育儿</a></td></tr>

<tr><td><a href="#家庭>宠物">宠物</a></td></tr>

<tr><td><a href="#家庭>家电">家电</a></td></tr>

<tr><td><a href="#家庭>家务事">家务事</a></td></tr>

<tr><td><a href="#家庭>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

 

<div id="menuLayer8" style="display:" onmouseover="javascript:displaysonmenu('sonmenu8')"><a href="layer.php?layer=教育>">教育</a>

<div id="sonmenu8" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#教育>文学">文学</a></td></tr>

<tr><td><a href="#教育>军事">军事</a></td></tr>

<tr><td><a href="#教育>留学移民">留学移民</a></td></tr>

<tr><td><a href="#教育>培训考试">培训考试</a></td></tr>

<tr><td><a href="#教育>学习园地">学习园地</a></td></tr>

<tr><td><a href="#教育>好书欣赏">好书欣赏</a></td></tr>

<tr><td><a href="#教育>艺术">艺术</a></td></tr>

<tr><td><a href="#教育>科学">科学</a></td></tr>

<tr><td><a href="#教育>其它">其它</a></td></tr>

</table></div></div></td></tr><tr><td>

<div id="menuLayer9" style="display:" onmouseover="javascript:displaysonmenu('sonmenu9')"><a href="layer.php?layer=其它>">其它</a>

<div id="sonmenu9" class=a_mo onmouseout="hidesonmenu()">

<table width="90%" border="1" cellspacing="2" cellpadding="2" align="center" bgcolor="" bordercolor="#6B9636">

<tr><td><a href="#其它>寻找">寻找</a></td></tr>

<tr><td><a href="#其它>征友">征友</a></td></tr>

<tr><td><a href="#其它>趣多多">趣多多</a></td></tr>

<tr><td><a href="#其它>星座与命理">星座与命理</a></td></tr>

<tr><td><a href="#其它>灵通告白">灵通告白</a></td></tr>

<tr><td><a href="#其它>其它">其它</a></td></tr>

</table></div></div></td></tr></table></td></tr></table>

<br></div>

<a href="http://www.7stk.com">建站资源</a></div>

0 Comments

Sun

01

Mar

2009

74、自由灵活的下拉菜单

74、自由灵活的下拉菜单

脚本说明:

把如下代码加入<body>区域中

<script>

function GoToWhere(s)

{

var d = s.options[s.selectedIndex].value;

window.open(d, "_blank");

s.selectedIndex=0;

}

//-->

</script>

<select  onChange=GoToWhere(this) name=select5 class="new">

<option selected>综合网站链接</option>

 <option value="http://www.7stk.com">网页特效代码</option>

<option value="http://www.sina.com">新浪</option>

</select>

0 Comments

Sun

01

Mar

2009

73、读取完毕才显示页面

73、读取完毕才显示页面

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

var url = 'http://www.7stk.com';

</script>

<div align=center>

<font class=fontbig>页面读取中请等待......<br>

</font>

<p></p><p></p>

<style><!--.proccess{border:1px solid;width:8;height:8;background:#ffffff;margin:3}--></style>

<p></p><p></p>

<div align="center">

<form method=post name=proccess>

<script language=javascript>

for(i=0;i<30;i++)document.write("<input class=proccess>")

</script>

</form>

</div></td></tr></table>

<div align="center">

<script language=JavaScript>var p=0,j=0;

var c=new Array("lightskyblue","white")

setInterval('proccess();',100)

function proccess(){

document.forms.proccess.elements[p].style.background=c[j];

p+=1;

if(p==30){p=0;j=1-j;}}

--></script>

</div>

</div>

<div align="center">

<script>

<!--

if (document.layers)

document.write('<Layer src="' + url + ' " VISIBILITY="hide"> </Layer>');

else if (document.all || document.getElementById)

document.write('<iframe src="' + url + '" style="visibility: hidden;"></iframe>');

else location.href = url;

//-->

</script>

</div>

 

 

 

第二步:把<body>中的内容改为:

<body  onLoad="location.href = url;" style='overflow:hidden;overflow-y:hidden'>

 

0 Comments

Sun

01

Mar

2009

72、模糊的文字导航

72、模糊的文字导航

脚本说明:

把如下代码加入<head>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function locktrueie(myform){myform.ie.checked=true;}

function lockfalsenet(myform){myform.nets.checked=true;}

function goToURL() { window.location = "http://www.k688.com"; }

 

function nochange(mycheckbox)

{

   if (mycheckbox.checked == true){mycheckbox.checked = false;}else{mycheckbox.checked = true;}

}

 

//  End -->

</script>

<style>

. tds

 {

  background-Color:silver;

  width:100;

  height:20;

  text-align:center;

  border:1px solid gray;

  font-size:14;

  filter:alpha(opacity=45);

  -moz-opacity:45%;

  cursor:crosshair;

 }

</style>

 

<script language="javascript">

nOpac = 50

nPlus = 2

nMin = 1

speed = 30

timer = null;

timer2 = null;

 

var ie5=(document.all && document.getElementById);

var ns6=(!document.all && document.getElementById);

 

function fadeImg2(teller)

{

 apl[teller][1] = "Up";

 changes();

}

 

function fadeImgend2(teller)

{

 apl[teller][1] = "Down";

 setTimeout("changes()",50);

}

 

function changes()

{

 next_loop = true;

 for (i=0;i<apl.length;i++)

 {

  obj = link_table.rows[i].cells[0];

  opacity = apl[i][0]

  if (apl[i][1] == "Up")

  {

     opacity += nPlus;

     apl[i][0] = opacity;

     if (apl[i][0] > 105)

      {apl[i][1] = "";}

     else

     {next_loop = false;}

        nOpac = opacity;

  }

  else

  {

  if (apl[i][1] == "Down")

  {

     opacity -= nMin;

     apl[i][0] = opacity;

     if (apl[i][0] < 45)

      {apl[i][1] = "";}

     else

     {next_loop = false;}

        nOpac = opacity;

  }

  }

  if(ie5){

       obj.style.filter="alpha(opacity="+opacity+")";

    }

  if(ns6){

     obj.style.MozOpacity = opacity + '%';

   }

 }

 if (next_loop == false)

  {

   timer = setTimeout("changes()",speed);

  }

  else

  {

   clearTimeout(timer);

  }

}

 

//for each link option you need to make a new Array;

var apl = new Array();

apl[0] = new Array(45,"");

apl[1] = new Array(45,"");

apl[2] = new Array(45,"");

apl[3] = new Array(45,"");

apl[4] = new Array(45,"");

apl[5] = new Array(45,"");

//expl: apl[6] = new Array(45,"");

</script>

<table cellpadding=0 cellspacing=0 name=link_table id=link_table>

<tr>

<td class="tds" onmouseover="fadeImg2(0)" onmouseout="fadeImgend2(0)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接一</td>

</tr>

<tr>

<td class="tds" onmouseover="fadeImg2(1)" onmouseout="fadeImgend2(1)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接二</td>

</tr>

<tr>

<td class="tds" onmouseover="fadeImg2(2)" onmouseout="fadeImgend2(2)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接三</td>

</tr>

<tr>

<td class="tds" onmouseover="fadeImg2(3)" onmouseout="fadeImgend2(3)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接四</td>

</tr>

<tr>

<td class="tds" onmouseover="fadeImg2(4)" onmouseout="fadeImgend2(4)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接五</td>

</tr>

<tr>

<td class="tds" onmouseover="fadeImg2(5)" onmouseout="fadeImgend2(5)" onclick="window.location='#';" style="border:1px solid gray;background-color:silver;width:100;text-align:center">链接六</td>

</tr>

</table>

 

 

0 Comments

Sun

01

Mar

2009

71、链接的下拉展开效果

71、链接的下拉展开效果

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript1.2">

var menu1=new Array()

menu1[0]='<a href=http://www.7stk.com/ target=_blank>网页特效代码</a><br>'

menu1[1]='<a href=http://www.7stk.com/fine/index.htm>精彩网页分享</a><br>'

menu1[2]='<a href=http://www.7stk.com/fine/index.htm>央视国际</a><br>'

menu1[3]='<a href=http://www.7stk.com/fine/index.htm>江苏音符</a><br>'

menu1[4]='<a href=http://www.7stk.com/fine/index.htm>网易</a><br>'

//Contents for menu 2

var menu2=new Array()

menu2[0]='<a href=http://www.163.com>×××××NBA</a><br>'

menu2[1]='<a href=http://www.hao123.com>××××××BBC</a><br>'

menu2[2]='<a href=http://www.sina.com>×××××AOL</a><br>'

</script>

<style>

<!--

.wrap1{

position:relative;

}

.wrap2{

position:absolute;

}

#dropmenu0, #dropmenu1{

z-index:100;

}

-->

</style>

<table width=400>

<tr><td width=200>

<script language="JavaScript1.2">

//reusable/////////////////////////////

 

//Drop down menu by http://www.dynamicdrive.com

 

var zindex=100

var ns4=document.layers

var ns6=document.getElementById&&!document.all

var ie4=document.all

var opr=navigator.userAgent.indexOf("Opera")

 

function dropit(e,whichone){

curmenuID=ns6? document.getElementById(whichone).id : eval(whichone).id

if (window.themenu&&themenu.id!=curmenuID)

themenuStyle.visibility=ns4?"hide" : "hidden"

 

themenu=ns6? document.getElementById(whichone): eval(whichone)

themenuStyle=(ns6||ie4)? themenu.style : themenu

 

themenuoffsetX=(ie4&&opr==-1)? document.body.scrollLeft : 0

themenuoffsetY=(ie4&&opr==-1)? document.body.scrollTop : 0

 

themenuStyle.left=ns6||ns4? e.pageX-e.layerX : themenuoffsetX+event.clientX-event.offsetX

themenuStyle.top=ns6||ns4? e.pageY-e.layerY+19 : themenuoffsetY+event.clientY-event.offsetY+18

 

hiddenconst=(ns6||ie4)? "hidden" : "hide"

if (themenuStyle.visibility==hiddenconst){

themenuStyle.visibility=(ns6||ie4)? "visible" : "show"

themenuStyle.zIndex=zindex++

}

else

hidemenu()

return false

}

 

function hidemenu(){

if ((ie4||ns6)&&window.themenu)

themenuStyle.visibility="hidden"

else if (ns4)

themenu.visibility="hide"

}

 

if (ie4||ns6)

document.onclick=hidemenu

 

//reusable/////////////////////////////

</script>

 

<!----------Menu 1 starts here---------->

 

<ilayer>

<layer visibility=show>

<div class=wrap1>

<span class=wrap2 onClick="dropit(event, 'dropmenu0');event.cancelBubble=true;return false"><font face=Verdana><b><a href="alternate.htm" onClick="if(ns4) return dropit(event, 'document.dropmenu0')">国内站点</a></b></font>

</span>

</div>

</layer>

</ilayer>

</td><td  width=200>

<!--webbot bot="HTMLMarkup" startspan -->

<ilayer>

<layer visibility=show>

<div class=wrap1>

<span class=wrap2 onClick="dropit(event, 'dropmenu1');event.cancelBubble=true;return false"><font face=Verdana><b><a href="alternate.htm" onClick="if(ns4) return dropit(event, 'document.dropmenu1')">国外站点</a></b></font>

</span>

</div>

</layer>

</ilayer>

</td></tr></table>

 

<div id=dropmenu0 style="position:absolute;left:0;top:0;layer-background-color:lightyellow;background-color:lightyellow;width:150;visibility:hidden;border:1px solid black;padding:0px">

<script language="JavaScript1.2">

if (document.all)

dropmenu0.style.padding="4px"

for (i=0;i<menu1.length;i++)

document.write(menu1[i])

</script>

</div>

<script language="JavaScript1.2">

if (document.layers){

document.dropmenu0.captureEvents(Event.CLICK)

document.dropmenu0.onclick=hidemenu

}

</script>

 

<div id=dropmenu1 style="position:absolute;left:0;top:0;layer-background-color:lightyellow;background-color:lightyellow;width:150;visibility:hidden;border:1px solid black;padding:0px">

<script language="JavaScript1.2">

if (document.all)

dropmenu1.style.padding="4px"

for (i=0;i<menu2.length;i++)

document.write(menu2[i])

</script>

</div>

 

 

0 Comments

Sun

01

Mar

2009

70、又一三层下拉菜单

70、又一三层下拉菜单

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var arrItems1 = new Array();

var arrItemsGrp1 = new Array();

 

arrItems1[3] = "Truck";

arrItemsGrp1[3] = 1;

arrItems1[4] = "Train";

arrItemsGrp1[4] = 1;

arrItems1[5] = "Car";

arrItemsGrp1[5] = 1;

 

arrItems1[6] = "Boat";

arrItemsGrp1[6] = 2;

arrItems1[7] = "Submarine";

arrItemsGrp1[7] = 2;

 

arrItems1[0] = "Planes";

arrItemsGrp1[0] = 3;

arrItems1[1] = "Ultralight";

arrItemsGrp1[1] = 3;

arrItems1[2] = "Glider";

arrItemsGrp1[2] = 3;

 

var arrItems2 = new Array();

var arrItemsGrp2 = new Array();

 

arrItems2[21] = "747";

arrItemsGrp2[21] = 0

arrItems2[22] = "Cessna";

arrItemsGrp2[22] = 0

 

arrItems2[31] = "Kolb Flyer";

arrItemsGrp2[31] = 1

arrItems2[34] = "Kitfox";

arrItemsGrp2[34] = 1

 

arrItems2[35] = "Schwietzer Glider";

arrItemsGrp2[35] = 2

 

arrItems2[99] = "Chevy Malibu";

arrItemsGrp2[99] = 5

arrItems2[100] = "Lincoln LS";

arrItemsGrp2[100] = 5

arrItems2[57] = "BMW Z3";

arrItemsGrp2[57] = 5

 

arrItems2[101] = "F-150";

arrItemsGrp2[101] = 3

arrItems2[102] = "Tahoe";

arrItemsGrp2[102] = 3

 

arrItems2[103] = "Freight Train";

arrItemsGrp2[103] = 4

arrItems2[104] = "Passenger Train";

arrItemsGrp2[104] = 4

 

arrItems2[105] = "Oil Tanker";

arrItemsGrp2[105] = 6

arrItems2[106] = "Fishing Boat";

arrItemsGrp2[106] = 6

 

arrItems2[200] = "Los Angelas Class";

arrItemsGrp2[200] = 7

arrItems2[201] = "Kilo Class";

arrItemsGrp2[201] = 7

arrItems2[203] = "Seawolf Class";

arrItemsGrp2[203] = 7

 

function selectChange(control, controlToPopulate, ItemArray, GroupArray)

{

  var myEle ;

  var x ;

  // Empty the second drop down box of any choices

  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;

  if (control.name == "firstChoice") {

    // Empty the third drop down box of any choices

    for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;

 }

  // ADD Default Choice - in case there are no values

  myEle = document.createElement("option") ;

  myEle.value = 0 ;

  myEle.text = "[SELECT]" ;

  controlToPopulate.add(myEle) ;

  // Now loop through the array of individual items

  // Any containing the same child id are added to

  // the second dropdown box

  for ( x = 0 ; x < ItemArray.length  ; x++ )

    {

      if ( GroupArray[x] == control.value )

        {

          myEle = document.createElement("option") ;

          myEle.value = x ;

          myEle.text = ItemArray[x] ;

          controlToPopulate.add(myEle) ;

        }

    }

}

//  End -->

</script>

<form name=myChoices>

<table align="center">

<tr>

<td>

<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">

       <option value=0 SELECTED>[SELECT]</option>

       <option value=1>Land</option>

       <option value=2>Sea</option>

       <option value=3>Air</option>

</SELECT>

</TD><TD>

<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">

</SELECT>

<SELECT id=thirdChoice name=thirdChoice>

</SELECT>

</TD>

</TR>

</TABLE>

</form>

 

0 Comments

Sun

01

Mar

2009

69、文字链接的滚动说明

69、文字链接的滚动说明

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

window.onerror = null;

 var bName = navigator.appName;

 var bVer = parseInt(navigator.appVersion);

 var NS4 = (bName == "Netscape" && bVer >= 4);

 var IE4 = (bName == "Microsoft Internet Explorer"

 && bVer >= 4);

 var NS3 = (bName == "Netscape" && bVer < 4);

 var IE3 = (bName == "Microsoft Internet Explorer"

 && bVer < 4);

 var scroll_length = 150; //The scroll length

 var time_length =50; //Scroll speed

 var begin_pos = 300; //Start position of scroll hint

 var i;

 var j;

if (NS4 || IE4) {

 if (navigator.appName == "Netscape") {

 layerStyleRef="layer.";

 layerRef="document.layers";

 styleSwitch="";

 }else{

 layerStyleRef="layer.style.";

 layerRef="document.all";

 styleSwitch=".style";

 }

}

//SCROLL

function Scroll(layerName){

if (NS4 || IE4) {

 if (NS4 || IE4) {

 if(i<(begin_pos+scroll_length)){

 eval(layerRef+'["'+layerName+'"]'+

 styleSwitch+'.visibility="visible"');

 eval(layerRef+'["'+layerName+'"]'+

 styleSwitch+'.left="'+i+'"');

 i++;

 j++;

 if(i==j){

 setTimeout("Scroll('"+layerName+"')",time_length);}

 }

 }

 }

}

//STOP SCROLLING

function StopScroll(layerName)

{

i=begin_pos+scroll_length;

  eval(layerRef+'["'+layerName+'"]'+

  styleSwitch+'.left="'+i+'"');

  hideLayer(layerName);

}

function reset()

{

i=begin_pos;

j=i;

}

// HIDE HINT

function hideLayer(layerName){

 if (NS4 || IE4) {

 eval(layerRef+'["'+layerName+'"]'+

 styleSwitch+'.visibility="hidden"');

 }

 }

//  End -->

</script>

<center>

<a href="http://www.7stk.com" class="link" onmouseover="javascript:reset();Scroll('prem_hint');" onmouseout="javascript:StopScroll('prem_hint');">七色天空</a>

</center>

<div id="prem_hint" style="position:relative; visibility:hidden" class="prem_hint">

给你最大的惊喜!!!!!!!!!!!!

</div>

 

1 Comments

Sun

01

Mar

2009

68、旋转导航文字圈 代码

68、旋转导航文字圈   代码

<body>

<style type="text/css">

BODY

{

background : #efefef;

font : 12px Verdana;

}

 

A { color : #e70 }

A:hover { text-decoration : none }

.spin

{

position : absolute;

visibility : hidden;

z-index : auto;

}

.spin A

{

font : 12px Verdana;

text-decoration : none;

}

.spin A:hover

{

text-decoration : underline overline;

}

</style>

<script language="JavaScript1.2">

function getPageSize()

{

       this.x = document.getElementsByTagName('html').item(0).clientWidth||document.getElementsByTagName('html').item(0).offsetWidth||document.body.offsetWidth||innerWidth

       this.y = document.getElementsByTagName('html').item(0).clientHeight||document.getElementsByTagName('html').item(0).offsetHeight||document.body.offsetHeight||innerHeight

       this.x2 = parseInt(this.x/2)||0

       this.y2 = parseInt(this.y/2)||0

       this.sx = document.body.scrollWidth||0

       this.sy = document.body.scrollHeight||0

}

var pg

 

var pi = 3.1415

 

function spinMenu(cls,rad,eSpd,rSpd,dir,x,y,noCt,runEx)

{

       pg = new getPageSize()

       this.cls = cls

       this.rad = rad

       this.eSpd = eSpd

       this.rSpd = rSpd

       this.dir = dir ? 1 : -1

       this.x = x<0 ? pg.x2 : x

       this.y = y<0 ? pg.y2 : y

       this.runEx = runEx||0

       this.noCt = noCt||0

       this.r = 0 // radius flux

       this.ex = 0 // expand timeout

       this.ct = 0 // contract timeout

       this.rt = 1 // rotate timeout

       this.vis = 0 // visibility

       this.rNum = 0 // rotational flux

       this.rSpd2 = 0 // rSpd holder

       this.exDone = 0 // expand complete?

       this.ctDone = 1 // contract complete?

       this.toFig = 0

       this.atX = 0

       this.atY = 0

       this.url = 0

       this.target = 0

       eval(this.obj + "=this")

       this.items = new Array()

       this.el = document.getElementsByTagName('div')

       for(i=0;(this.el.item(i));i++)

       {

              if(this.el.item(i).className==this.cls)

              {

                     this.el.item(i).onmouseover = new Function(this.obj+'.stop()')

                     this.el.item(i).onmouseout = new Function(this.obj+'.rotate()')

                     this.el.item(i).onclick = new Function(this.obj+'.contract()')

                     this.items[this.items.length] = this.el.item(i)

              }

       }

       delete this.el

       for(i=0;(this.items[i]);i++)

       {

              if(!this.items[i].childNodes.item(0).nodeValue)

              {

                     this.items[i].childNodes.item(0).onmouseover = new Function('status=this.href;return true')

                     this.items[i].childNodes.item(0).onmouseout = new Function('status=\'\';return true')

                     this.items[i].childNodes.item(0).onclick = new Function(this.obj+'.setURL(this.href,this.target);return false')

                     this.items[i].childNodes.item(0).onfocus = new Function('this.blur()')

              }

       }

       return this

}

spinMenu.prototype.init = function()

{

       this.hide()

       this.place()

       this.expand()

}

spinMenu.prototype.rotate = function()

{

       if(this.rSpd)

       {

              this.rNum += pi/(1000/this.rSpd)*this.dir

              if(this.exDone)

              {

                     this.place()

                     clearTimeout(this.rt)

                     this.rt = setTimeout(this.obj+'.rotate()',20)

              }

       }

}

spinMenu.prototype.stop = function()

{

       clearTimeout(this.rt)

       this.rt = 0

}

spinMenu.prototype.expand = function()

{

       if(this.exDone!=1)

       {

              this.ctDone=0

              if(!this.vis) this.show()

              if(this.runEx) eval(this.runEx)

              if(this.ct!=0)

              {

                     clearTimeout(this.ct)

                     this.ct = 0

              }

              if(this.r<this.rad)

              {

                     this.r += this.eSpd

                     if(this.rSpd2==0) this.rSpd2 = this.rSpd

                     this.rSpd = this.eSpd*3

                     this.rotate()

                     this.place()

                     this.ex = setTimeout(this.obj+'.expand()',10)

              }

              else

              {

                     this.ex = 0

                     this.rSpd = this.rSpd2

                     this.rSpd2 = 0

                     this.ctDone = 0

                     this.exDone = 1

                     this.rotate()

              }

       }

}

spinMenu.prototype.contract = function()

{

       if(this.ctDone!=1&&!this.noCt)

       {

              this.exDone = 0

              if(this.ex!=0)

              {

                     clearTimeout(this.ex)

                     this.ex = 0

              }

              if(this.r>0)

              {

                     this.r -= this.eSpd

                     if(this.rSpd2==0) this.rSpd2 = this.rSpd

                     this.rSpd = this.eSpd

                     this.rotate()

                     this.place()

                     this.ct = setTimeout(this.obj+'.contract()',10)

              }

              else

              {

                     this.rSpd = this.rSpd2

                     this.rSpd2 = 0

                     this.rNum = 0

                     this.stop()

                     this.hide()

                     this.exDone = 0

                     this.ctDone = 1

                     this.goURL()

              }

       }

       else this.goURL()

}

spinMenu.prototype.place = function()

{

       for(i=0;(this.items[i]);i++)

       {

              this.atPt(i)

              this.items[i].style.left = this.atX-(this.items[i].offsetWidth/2)+'px'

              this.items[i].style.top = this.atY-(this.items[i].offsetHeight/2)+'px'

       }

}

spinMenu.prototype.atPt = function(pt)

{

       this.toFig = pi/(this.items.length/2)*(pt+this.rNum)

       this.atX = parseInt(Math.cos(this.toFig)*this.r+this.x)

       this.atY = parseInt(Math.sin(this.toFig)*this.r+this.y)

}

spinMenu.prototype.show = function()

{

       for(i=0;(this.items[i]);i++)

       {

              this.items[i].style.display = 'block'

              this.items[i].style.visibility = 'visible'

              this.vis = 1

       }

}

spinMenu.prototype.hide = function()

{

       for(i=0;(this.items[i]);i++)

       {

              this.items[i].style.visibility = 'hidden'

              this.items[i].style.display = 'none'

              this.vis = 0

       }

}

spinMenu.prototype.changeDir = function()

{

       this.dir = this.dir==1 ? -1 : 1

}

spinMenu.prototype.setURL = function(url,target)

{

       this.url = url

       this.target = target

}

spinMenu.prototype.goURL = function()

{

       if(this.url)

       {

              if(!this.target)

                     if(document.getElementsByTagName('base').length) this.target = document.getElementsByTagName('base').item(0).target

              if(this.target)

              {

                     if(this.target=='_blank') open(this.url)

                     else if(this.target=='_parent') parent.location = this.url

                     else if(this.target=='_top') top.location = this.url

                     else if(this.target.indexOf('_')<0)

                     {

                            if(eval('parent.'+this.target)) eval('parent.'+this.target+'.document.location=this.url')

                            else if(eval('top.'+this.target)) eval('top.'+this.target+'.document.location=this.url')

                            else open(this.url,this.target)

                     }

                     else location = this.url

              }

              else location = this.url

              this.url = 0

       }

}

 

</script>

<script language="JavaScript1.2" type="text/javascript">

function centerIt()

{

pg = new getPageSize()

menu.x = pg.x2-10

menu.y = pg.y2

}

function initSpinMenu()

{

menu = new spinMenu(

'spin', // className

120, // radius

12, // expand/contract speed

3, // rotational speed

1, // direction (cw=1,ccw=0)

-1, // origin x

-1, // origin y

0, // stay expanded?

0 // run before expand

)

menu.init()

}

onload=initSpinMenu

onresize=centerIt

</script>

<base target="newWin">

<div align="right"><a href="javascript:menu.expand()" target="_self">展开</a> | <a href="javascript:menu.contract()" target="_self">隐藏</a> | <a href="javascript:menu.stop()" target="_self">停止</a> | <a href="javascript:menu.rotate()" target="_self">旋转</a> | <a href="javascript:menu.changeDir()" target="_self">改变旋转方向</a></div>

<div class="spin"><a href="http://www.7stk.com">网页特效代码</a></div>

<div class="spin"><a href="http://www.7stk.com/fine/index.htm">精彩网页分享</a></div>

<div class="spin"><a href="http://www.7stk.com/radio/radio.htm">音乐电台代码</a></div>

<div class="spin"><a href="http://www.7stk.com/music/music.htm">音乐播放器</a></div>

<div class="spin"><a href="http://www.7stk.com/flash/flash.htm">Flash特效代码</a></div>

<div class="spin"><a href="http://www.7stk.com/caidan/caidan.htm">菜单特效代码</a></div>

<div class="spin"><a href="http://www.163.com">网易</a></div>

0 Comments

Sun

01

Mar

2009

67、页面顶部下拉导航菜单

67、页面顶部下拉导航菜单

脚本说明:

第一步:把如下代码加入<body>区域中

<style>

BODY {font-size:9pt;color:white;background-color:yellow}

TABLE{font-size:9pt;color:snow;background-color:darkblue;BORDER-COLLAPSE: collapse;text-align:center}

DIV{font-size:9pt;color:springgreen;background-color:green}

TD{cursor:hand}

FONT {font-size:9pt;color:lime;cursor:hand}

.over {color:gold;background-color:slateblue}

.out{ color:snow;background-color:darkblue}

</style>

<script>

function popmenu(obj1)

{

obj1.className="over";

menu1.style.backgroundColor="slateblue";

menu1.style.borderTopColor="slateblue";

menu1.style.top=obj1.offsetTop+obj1.offsetHeight;

menu2.style.top=obj1.offsetTop+obj1.offsetHeight+10;

menu1.style.left=obj1.offsetLeft+obj1.offsetWidth/2-40;

menu2.style.left=obj1.offsetLeft+obj1.offsetWidth/2-30;

menu1.style.display="";

menu2.style.display="";

}

function menuout(obj1) {

obj1.className="out";

menu1.style.backgroundColor="darkblue";

menu1.style.borderTopColor="darkblue";

}

function menuclear()

{ if (event.toElement.tagName!="FONT")

   {

      menu1.style.display='none';

      menu2.style.display='none';         

   }

}

function hide()

{menu1.style.display='none';menu2.style.display='none';}

</script>

 

<script>

for(x=0;x<=document.body.offsetWidth;x+=10){

document.write("<div style='position:absolute;left:"+x+";top:0;height:100%;width:1;font-size:1pt;background-color:gray;border:0;z-index:-2'></div>")

}

for(x=0;x<=document.body.offsetHeight;x+=10) {

document.write("<div style='position:absolute;left:0;top:"+x+";height:1;width:100%;font-size:1pt;background-color:gray;border:0;z-index:-2'></div>")

}

</script>

<div id=menu1 onmouseout="menuclear()" style="position:absolute;text-align:center;color:snow;background-color:slateblue;top:100;left:100;height:200;width:80;display:none;border-style:solid;border-width:1;border-color:cyan;border-top-color:slateblue;z-index:1">

<br>

<script>

for(x=0;x<11;x++){document.write("<font onmouseover=this.style.color='red' onmouseout=this.style.color='lime'>子菜单一</font><br>");}

</script>

</div>

<div id=menu2 style="position:absolute;Filter:Alpha(opacity=40);background-color:black;height:200;width:80;z-index:-1;display:none"></div>

<table border="1" cellspacing="1" width="100%" bordercolor="#00FFFF" style="position: absolute; top: 0" >

  <tr>

    <td width="16%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'" >主页</td>

    <td width="16%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'">菜单一</td>

    <td width="17%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'">菜单二</td>

    <td width="17%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'">菜单三</td>

    <td width="17%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'">菜单四</td>

    <td width="17%" onmouseover="popmenu(this)" onmouseout="menuout(this)" onclick="menu1.style.display='none';menu2.style.display='none'">菜单五</td>

  </tr>

</table>

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onresize="location.reload()">

 

0 Comments

Sun

01

Mar

2009

66、链接的滚动说明

66、链接的滚动说明

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

 

window.onerror = null;

 

 var bName = navigator.appName;

 

 var bVer = parseInt(navigator.appVersion);

 

 var NS4 = (bName == "Netscape" && bVer >= 4);

 

 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);

 

 var NS3 = (bName == "Netscape" && bVer < 4);

 

 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

 

 

 

//-----------------------------------------------------------

 

 var scroll_length = 150; //The scroll length

 

 var time_length =50; //Scroll delay in milliseconds

 

 var begin_pos = 260; //Start position of scroll hint

 

 var i=begin_pos;

 

 var j=i;

 

 var scroll_dir = "right"; // To scroll left use "left"

 

                           // To scroll right use "right"

 

//-----------------------------------------------------------

 

 

 

if (NS4 || IE4) {

 

 if (navigator.appName == "Netscape") {

 

 layerStyleRef="layer.";

 

 layerRef="document.layers";

 

 styleSwitch="";

 

 }else{

 

 layerStyleRef="layer.style.";

 

 layerRef="document.all";

 

 styleSwitch=".style";

 

 }

 

}

 

 

 

//SCROLL

 

function Scroll(layerName)

 

{

 

 if (NS4 || IE4)

 

 {

 

  if(scroll_dir=="right")

 

  {

 

   if(i<(begin_pos+scroll_length))

 

   {

 

    eval(layerRef+'["'+layerName+'"]'+

 

    styleSwitch+'.visibility="visible"');

 

    eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.left="'+(i)+'"');

 

    i++;

 

    j++;

 

   }

 

  }

 

  if(scroll_dir=="left")

 

  {

 

   if(i>(begin_pos-scroll_length))

 

   {

 

    eval(layerRef+'["'+layerName+'"]'+

 

    styleSwitch+'.visibility="visible"');

 

    eval(layerRef+'["'+layerName+'"]'+ styleSwitch+'.right="'+(-i)+'"');

 

    i--;

 

    j--;

 

   }

 

  }

 

  if(i==j)

 

  {

 

   setTimeout("Scroll('"+layerName+"')",time_length);

 

  }

 

 }

 

}

 

 

 

//STOP SCROLLING

 

function StopScroll(layerName)

 

{

 

 if(scroll_dir=="right")

 

 {

 

  i=begin_pos+scroll_length;

 

  eval(layerRef+'["'+layerName+'"]'+

 

  styleSwitch+'.left="'+(i)+'"');

 

  hideLayer(layerName);

 

 }

 

 if(scroll_dir=="left")

 

 {

 

  i=begin_pos-scroll_length;

 

  eval(layerRef+'["'+layerName+'"]'+

 

  styleSwitch+'.right="'+(-i)+'"');

 

  hideLayer(layerName);

 

 }

 

}

 

 

 

function reset()

 

{

 

 i=begin_pos;

 

 j=i;

 

}

 

 

 

// HIDE HINT

 

function hideLayer(layerName)

 

{

 

 if (NS4 || IE4)

 

 {

 

  eval(layerRef+'["'+layerName+'"]'+

 

  styleSwitch+'.visibility="hidden"');

 

 }

 

}

 

//  End -->

 

</script>

<a href="http://www.7stk.com/" class="link" onmouseover="javascript:reset();Scroll('prem_hint');" onmouseout="javascript:StopScroll('prem_hint');">网页特效代码</a>

 

<div id="prem_hint" style="position:relative; visibility:hidden" class="prem_hint">

 

<b>全部是javascript的各种资源</b>

 

</div>

 

1 Comments

Sun

01

Mar

2009

65、链接在IFRAME中显示

65、链接在IFRAME中显示

脚本说明:

把如下代码加入<body>区域中

<script>

function showitem(id,name)

{

if (id==1){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if(id==2){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if(id==3){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id == 4){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==5){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==6){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==11){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==12){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==21){

       return ("<a target=frmright href='http://www.7stk.com/' class='a1'>"+name+"</a><br>")

       }else if (id==22){

       return ("<a target=frmright href='地址' class='a1'>"+name+"</a><br>")

       }else if (id==31){

       return ("<a target=frmright href='地址' class='a1'>"+name+"</a><br>")

       }else if (id==32){

       return ("<a target=frmright href='地址' class='a1'>"+name+"</a><br>")

       }

}

function switchoutlookBar(number)

{

var i = outlookbar.opentitle;

outlookbar.opentitle=number;

var id1,id2,id1b,id2b

if (number!=i && outlooksmoothstat==0){

if (number!=-1)

{

if (i==-1)

{

id2="blankdiv";

id2b="blankdiv";}

else{

id2="outlookdiv"+i;

id2b="outlookdivin"+i;

document.all("outlooktitle"+i).style.border="0px none navy";

//document.all("outlooktitle"+i).style.background="#A5BACE"; //打开过后的显示背景色

//未激活BAR

//     document.all("outlooktitle"+i).style.color="#738294";

document.all("outlooktitle"+i).style.textalign="center";

}

id1="outlookdiv"+number

id1b="outlookdivin"+number

//document.all("outlooktitle"+number).style.border="1px none white";

//document.all("outlooktitle"+number).style.background="#A5BACE";

//激活BAR

//document.all("outlooktitle"+number).style.color="#EFEBEF";

document.all("outlooktitle"+number).style.textalign="center";

smoothout(id1,id2,id1b,id2b,0);

}

else

{

document.all("blankdiv").style.display="";

document.all("blankdiv").sryle.height="100%";

document.all("outlookdiv"+i).style.display="none";

document.all("outlookdiv"+i).style.height="0%";

document.all("outlooktitle"+i).style.border="0px none navy";

//     document.all("outlooktitle"+i).style.background="YELLOW";

document.all("outlooktitle"+i).style.color="black";

document.all("outlooktitle"+i).style.textalign="center";

}

}

}

function smoothout(id1,id2,id1b,id2b,stat)

{

if(stat==0){

tempinnertext1=document.all(id1b).innerHTML;

tempinnertext2=document.all(id2b).innerHTML;

document.all(id1b).innerHTML="";

document.all(id2b).innerHTML="";

outlooksmoothstat=1;

document.all(id1b).style.overflow="hidden";

document.all(id2b).style.overflow="hidden";

document.all(id1).style.height="0%";

document.all(id1).style.display="";

setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);

}

else

{

stat+=outlookbar.inc;

if (stat>100)

stat=100;

document.all(id1).style.height=stat+"%";

document.all(id2).style.height=(100-stat)+"%";

if (stat<100)

setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);

else

{

document.all(id1b).innerHTML=tempinnertext1;

document.all(id2b).innerHTML=tempinnertext2;

outlooksmoothstat=0;

document.all(id1b).style.overflow="auto";

document.all(id2).style.display="none";

}

}

}

function getOutLine()

{

outline="<table "+outlookbar.otherclass+" align=center>";

for (i=0;i<(outlookbar.titlelist.length);i++)

{

outline+="<tr><td align=center name=outlooktitle"+i+" id=outlooktitle"+i+" ";            

if (i!=outlookbar.opentitle)

outline+=" nowrap align=center bgcolor='c0c0c0' style='cursor:hand;height:18;border:0 none navy' ";

else

outline+=" nowrap align=center bgcolor='c0c0c0' style='cursor:hand;background-color:#005D99;color:white;height:18;border:0 none white' ";

outline+=outlookbar.titlelist[i].otherclass

outline+=" onclick='switchoutlookBar("+i+")'>";

outline+=outlookbar.titlelist[i].title+"</td></tr>";

//显示分论坛内容的表格(down)

outline+="<tr><td align=center name=outlookdiv"+i+" valign=top align=center  id=outlookdiv"+i+" style='width:108"

if (i!=outlookbar.opentitle)

outline+=";display:none;height:0%;";

else

outline+=";display:;height:100%;";

outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:108;height:100%'>";

for (j=0;j<outlookbar.itemlist[i].length;j++)

outline+=showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title);

outline+="</div></td></tr>"

}

//初始状态的表格(d)

outline+="<tr><td align=center name=blankdiv valign=top align=center  id=blankdiv style='height:100%;width:108:"

if (outlookbar.opentitle!=-1)

outline+=";display:none;";

else

outline+=";display:;";

outline+="'><div style='overflow:auto;width:108;height:100%'>";

outline+="</div></td></tr>"

outline+="</table>"

return outline

}

function show()

{

var outline;

outline="<div id=outLookBarDiv name=outLookBarDiv style='width=108;height:100%'>"

outline+=outlookbar.getOutLine();

outline+="</div>"

document.write(outline);

}

function theitem(intitle,instate,inkey)

{

this.state=instate;

this.otherclass=" nowrap  align=center";

this.key=inkey;

this.title=intitle;

}

function addtitle(intitle)

{

outlookbar.itemlist[outlookbar.titlelist.length]=new Array();

outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);

return(outlookbar.titlelist.length-1);

}

function additem(intitle,parentid,inkey)

{

if (parentid>=0 && parentid<=outlookbar.titlelist.length)

{

outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);

outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=center style='backgroundColor:blue;height:5' ";

return(outlookbar.itemlist[parentid].length-1);

}

else

additem=-1;

}

function outlook()

{

this.titlelist=new Array();