473,703 Members | 3,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

slide menu how to make it relative to table

I have following code for a slide menu but i twiked it to work for a
single level menu. Open it in a Browser to get a clear picture.

I have 2 Qs
1) How to make first entry as non-link. i.e i want to make first text
as Table Heading/menu category. For examle in the given menu i want to
make a heading as "Comp. Languages" which won't be a link.

2) The position of this menu is absolute to the page. I want to make
it absolute to the Table (2nd down table). So that this menu doesn't
move with resizing of window.

Basically my requirement is not of a sliding menu. I want to have a
menu with the same effect as it's achieved by this manu. i.e when i
hover over a link it should highlight the complete row.

Tx
Ajay
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="GENERATOR " content="Mozill a/4.79 [en] (Windows NT 5.0; U)
[Netscape]">
<title>Ajay's Home Page</title>
</head>
<body>
&nbsp;
<center><tabl e BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="800"
HEIGHT="50" BGCOLOR="#FF5B5 B" >
<tr>
<td>
<center><font color="#FFFF00" ><font size=+3>Ajay's Home
Page</font></font></center>
</td>
</tr>
</table></center>

<center><tabl e BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="800"
HEIGHT="350" BGCOLOR="#FFA8A 8" >
<tr>
<td>
<p><script type='text/javascript'>

function Go(){return}
/*************** *************** *************** *************** ***********
YOU CAN MANUALLY CHANGE THE MENU HERE, BUT BE VERY CAREFUL !
*************** *************** *************** *************** ***********/
Menu1=new Array("C","http ://","",0,20,1 50);
Menu2=new Array("Data Structure","htt p://","",0,20,1 50);
Menu3=new Array("C++","ht tp://","",0,20,1 50);
Menu4=new Array("Borland C++ Builder","http://","",0,20,1 50);
Menu5=new Array("HTML","h ttp://","",0,20,1 50);
Menu6=new Array("ASN.1"," http://","",0,20,1 50);
Menu7=new Array("PERL","h ttp://","",0,20,1 50);
Menu8=new Array("Delphi", "http://","",0,20,1 50);
Menu9=new Array("SDL","ht tp://","",0,20,1 50);
Menu10=new Array("OOD","ht tp://","",0,20,1 50);
Menu11=new Array("UML","ht tp://","",0,20,1 50);
var NoOffFirstLineM enus=11; // Number of first level items
var LowBgColor='FFD 9D9'; // Background color when mouse is not over
var LowSubBgColor=' 0080FF'; // Background color when mouse is not over
on subs
var HighBgColor='FF FFFF'; // Background color when mouse is over
var HighSubBgColor= '009CE8'; // Background color when mouse is over on
subs
var FontLowColor='0 000FF'; // Font color when mouse is not over
var FontSubLowColor ='FFFFFF'; // Font color subs when mouse is not
over
var FontHighColor=' 0000FF'; // Font color when mouse is over
var FontSubHighColo r='0000FF'; // Font color subs when mouse is over
var BorderColor='00 0000'; // Border color
var BorderSubColor= '000000'; // Border color for subs
var BorderWidth=1; // Border width
var BorderBtwnElmnt s=1; // Border between elements 1 or 0
var FontFamily="Tah oma, Verdana, Arial" // Font family menu items
var FontSize=11; // Font size menu items
var FontBold=0; // Bold menu items 1 or 0
var FontItalic=0; // Italic menu items 1 or 0
var MenuTextCentere d='left'; // Item text position 'left', 'center' or
'right'
var MenuCentered='l eft'; // Menu horizontal position 'left', 'center'
or 'right'
var MenuVerticalCen tered='top'; // Menu vertical position 'top',
'middle','botto m' or static
var ChildOverlap=.2 ; // horizontal overlap child/ parent
var ChildVerticalOv erlap=.2; // vertical overlap child/ parent
var StartTop=200; // Menu offset x coordinate
var StartLeft=200; // Menu offset y coordinate
var VerCorrect=0; // Multiple frames y correction
var HorCorrect=0; // Multiple frames x correction
var LeftPaddng=4; // Left padding
var TopPaddng=0; // Top padding
var FirstLineHorizo ntal=0; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR
VERTICAL
var MenuFramesVerti cal=1; // Frames in cols or rows 1 or 0
var DissapearDelay= 1000; // delay before menu folds in
var TakeOverBgColor =1; // Menu frame takes over background color
subitem frame
var FirstLineFrame= 'navig'; // Frame where first level appears
var SecLineFrame='s pace'; // Frame where sub levels appear
var DocTargetFrame= 'space'; // Frame where target documents appear
var TargetLoc=''; // span id for relative positioning
var HideTop=0; // Hide first level when loading new document 1 or 0
var MenuWrap=1; // enables/ disables menu wrap 1 or 0
var RightToLeft=0; // enables/ disables right to left unfold 1 or 0
var UnfoldsOnClick= 1; // Level 1 unfolds onclick/ onmouseover
var WebMasterCheck= 0; // menu tree checking on or off 1 or 0
var ShowArrow=0; // Uses arrow gifs when 1
var KeepHilite=0; // Keep selected path highligthed
var Arrws=['tridark.gif',5 ,10,'tridarkdow n.gif',10,5,'tr idarkleft.gif', 5,10];
// Arrow source, width and height

/*************** *************** *************** *************** ***********
DO NOT EDIT ANYTHING BELOW THIS LINE - IT WILL BREAK THE SCRIPT !
*************** *************** *************** *************** ***********/

var AgntUsr=navigat or.userAgent.to LowerCase();
var DomYes=document .getElementById ?1:0;
var NavYes=AgntUsr. indexOf('mozill a')!=-1&&AgntUsr.inde xOf('compatible ')==-1?1:0;
var ExpYes=AgntUsr. indexOf('msie') !=-1?1:0;
var Opr=AgntUsr.ind exOf('opera')!=-1?1:0;
var Opr6orless=wind ow.opera &&
navigator.userA gent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.co m
added code
var DomNav=DomYes&& NavYes?1:0;
var DomExp=DomYes&& ExpYes?1:0;
var Nav4=NavYes&&!D omYes&&document .layers?1:0;
var Exp4=ExpYes&&!D omYes&&document .all?1:0;
var PosStrt=(NavYes ||ExpYes)&&!Opr 6orless?1:0;
var FrstLoc,ScLoc,D cLoc;
var ScWinWdth,ScWin Hght,FrstWinWdt h,FrstWinHght;
var ScLdAgainWin;
var FirstColPos,Sec ColPos,DocColPo s;
var RcrsLvl=0;
var FrstCreat=1,Loa dd=0,Creatd=0,I niFlg,AcrssFrms =1;
var FrstCntnr=null, CurrntOvr=null, CloseTmr=null;
var CntrTxt,TxtClos e,ImgStr;
var Ztop=100;
var ShwFlg=0;
var M_StrtTp=StartT op,M_StrtLft=St artLeft;
var StaticPos=0;
var LftXtra=DomNav& &!Opr?LeftPaddn g:0; //Changed for Opera
var TpXtra=DomNav?T opPaddng:0;
var M_Hide=Nav4?'hi de':'hidden';
var M_Show=Nav4?'sh ow':'visible';
var Par=parent.fram es[0]&&FirstLineFram e!=SecLineFrame ?parent:window;
var Doc=Par.documen t;
var Bod=Doc.body;
var Trigger=NavYes& &!Opr?Par:Bo d; //Changed for Opera

MenuTextCentere d=MenuTextCente red==1||MenuTex tCentered=='cen ter'?'center':M enuTextCentered ==0||
MenuTextCentere d!='right'?'lef t':'right';
WbMstrAlrts=["Item not defined: ","Item needs height: ","Item needs
width: "];

if(Trigger.onlo ad)Dummy=Trigge r.onload;
if(DomNav||Opr) Trigger.addEven tListener('load ',Go,false); //Changed
for Opera
else Trigger.onload= Go;

function Dummy(){return}

function CnclSlct(){retu rn false}

function RePos(){
FrstWinWdth=Exp Yes?FrstLoc.doc ument.body.clie ntWidth:FrstLoc .innerWidth;
FrstWinHght=Exp Yes?FrstLoc.doc ument.body.clie ntHeight:FrstLo c.innerHeight;
ScWinWdth=ExpYe s?ScLoc.documen t.body.clientWi dth:ScLoc.inner Width;
ScWinHght=ExpYe s?ScLoc.documen t.body.clientHe ight:ScLoc.inne rHeight;
if(MenuCentered =='justify'&&Fi rstLineHorizont al){
FrstCntnr.style .width=FrstWinW dth;
ClcJus();
var P=FrstCntnr.Frs tMbr,W=Menu1[5],i;
for(i=0;i<NoOff FirstLineMenus; i++){P.style.wi dth=W;P=P.PrvMb r}}
StaticPos=-1;
if(TargetLoc)Cl cTrgt();
if(MenuCentered )ClcLft();
if(MenuVertical Centered)ClcTp( );
PosMenu(FrstCnt nr,StartTop,Sta rtLeft)}

function UnLoaded(){
if(CloseTmr)cle arTimeout(Close Tmr);
Loadd=0; Creatd=0;
if(HideTop){
var FCStyle=Nav4?Fr stCntnr:FrstCnt nr.style;
FCStyle.visibil ity=M_Hide}}

function ReDoWhole(){
if(ScWinWdth!=S cLoc.innerWidth ||ScWinHght!=Sc Loc.innerHeight ||FrstWinWdth!= FrstLoc.innerWi dth||
FrstWinHght!=Fr stLoc.innerHeig ht)Doc.location .reload()}

function Check(WMnu,NoOf ){
var i,array,ArrayLo c;
ArrayLoc=parent .frames[0]?parent.frames[FirstLineFrame]:self;
for(i=0;i<NoOf; i++){
array=WMnu+eval (i+1);
if(!ArrayLoc[array]){WbMstrAlrt(0, array); return false}
if(i==0){ if(!ArrayLoc[array][4]){WbMstrAlrt(1, array); return false}
if(!ArrayLoc[array][5]){WbMstrAlrt(2, array); return false}}
if(ArrayLoc[array][3])if(!Check(arra y+'_',ArrayLoc[array][3])) return
false}
return true}

function WbMstrAlrt(No,X tra){
return confirm(WbMstrA lrts[No]+Xtra+' ')}

function Go(){
Dummy();
if(Loadd||!PosS trt)return;
BeforeStart();
Creatd=0; Loadd=1;
status='Buildin g menu';
if(FrstCreat){
if(FirstLineFra me =="" || !parent.frames[FirstLineFrame]){
FirstLineFrame= SecLineFrame;
if(FirstLineFra me =="" || !parent.frames[FirstLineFrame]){
FirstLineFrame= SecLineFrame=Do cTargetFrame;
if(FirstLineFra me =="" ||
!parent.frames[FirstLineFrame])FirstLineFrame =SecLineFrame=D ocTargetFrame=' '}}
if(SecLineFrame =="" || !parent.frames[SecLineFrame]){
SecLineFrame=Do cTargetFrame;
if(SecLineFrame =="" ||
!parent.frames[SecLineFrame])SecLineFrame=D ocTargetFrame=F irstLineFrame}
if(DocTargetFra me =="" ||
!parent.frames[DocTargetFrame])DocTargetFrame =SecLineFrame;
if(WebMasterChe ck){ if(!Check('Menu ',NoOffFirstLin eMenus)){status ='build
aborted';return }}
FrstLoc=FirstLi neFrame!=""?par ent.frames[FirstLineFrame]:window;
ScLoc=SecLineFr ame!=""?parent. frames[SecLineFrame]:window;
DcLoc=DocTarget Frame!=""?paren t.frames[DocTargetFrame]:window;
if (FrstLoc==ScLoc ) AcrssFrms=0;
if (AcrssFrms)Firs tLineHorizontal =MenuFramesVert ical?0:1;
FrstWinWdth=Exp Yes?FrstLoc.doc ument.body.clie ntWidth:FrstLoc .innerWidth;
FrstWinHght=Exp Yes?FrstLoc.doc ument.body.clie ntHeight:FrstLo c.innerHeight;
ScWinWdth=ExpYe s?ScLoc.documen t.body.clientWi dth:ScLoc.inner Width;
ScWinHght=ExpYe s?ScLoc.documen t.body.clientHe ight:ScLoc.inne rHeight;
if(Nav4){ CntrTxt=MenuTex tCentered!='lef t'?"<div
align='"+MenuTe xtCentered+"'>" :"";
TxtClose="</font>"+MenuText Centered!='left '?"</div>":""}}
FirstColPos=Nav 4?FrstLoc.docum ent:FrstLoc.doc ument.body;
SecColPos=Nav4? ScLoc.document: ScLoc.document. body;
DocColPos=Nav4? DcLoc.document: ScLoc.document. body;
if (TakeOverBgColo r)FirstColPos.b gColor=AcrssFrm s?SecColPos.bgC olor:DocColPos. bgColor;
if(MenuCentered =='justify'&&Fi rstLineHorizont al)ClcJus();
if(FrstCreat){
FrstCntnr=Creat eMenuStructure( 'Menu',NoOffFir stLineMenus);
FrstCreat=Acrss Frms?0:1}
else CreateMenuStruc tureAgain('Menu ',NoOffFirstLin eMenus);
if(TargetLoc)Cl cTrgt();
if(MenuCentered )ClcLft();
if(MenuVertical Centered)ClcTp( );
PosMenu(FrstCnt nr,StartTop,Sta rtLeft);
IniFlg=1;
Initiate();
Creatd=1;
if (AcrssFrms) //Added for Opera
{ //Added for Opera
ScLdAgainWin=Ex pYes?ScLoc.docu ment.body:ScLoc ;
ScLdAgainWin.on unload=UnLoaded ;
} //Added for Opera
Trigger.onresiz e=Nav4?ReDoWhol e:RePos;
AfterBuild();
if(MenuVertical Centered=='stat ic'&&!AcrssFrms )setInterval('K eepPos()',250);
status='Menu ready for use'}

function KeepPos(){
var TS=ExpYes?FrstL oc.document.bod y.scrollTop:Frs tLoc.pageYOffse t;
if(TS!=StaticPo s){
var FCStyle=Nav4?Fr stCntnr:FrstCnt nr.style;
FCStyle.top=Frs tCntnr.OrgTop=S tartTop+TS;Stat icPos=TS}}

function ClcJus(){
var a=BorderBtwnElm nts?1:2,b=Borde rBtwnElmnts?Bor derWidth:0;
var Size=Math.round (((FrstWinWdth-a*BorderWidth)/NoOffFirstLineM enus)-b),i,j;
for(i=1;i<NoOff FirstLineMenus+ 1;i++){j=eval(' Menu'+i);j[5]=Size}
StartLeft=0}

function ClcTrgt(){
var TLoc=Nav4?FrstL oc.document.lay ers[TargetLoc]:DomYes?FrstLoc .document.getEl ementById(Targe tLoc):FrstLoc.d ocument.all[TargetLoc];
StartTop=M_Strt Tp;
StartLeft=M_Str tLft;
if(DomYes){
while(TLoc){Sta rtTop+=TLoc.off setTop;StartLef t+=TLoc.offsetL eft;TLoc=TLoc.o ffsetParent}}
else{ StartTop+=Nav4? TLoc.pageY:TLoc .offsetTop;Star tLeft+=Nav4?TLo c.pageX:TLoc.of fsetLeft}}

function ClcLft(){
if(MenuCentered !='left'&&MenuC entered!='justi fy'){
var Size=FrstWinWdt h-(!Nav4?parseInt (FrstCntnr.styl e.width):FrstCn tnr.clip.width) ;
StartLeft=M_Str tLft;
StartLeft+=Menu Centered=='righ t'?Size:Size/2}}

function ClcTp(){
if(MenuVertical Centered!='top' &&MenuVerticalC entered!='stati c'){
var Size=FrstWinHgh t-(!Nav4?parseInt (FrstCntnr.styl e.height):FrstC ntnr.clip.heigh t);
StartTop=M_Strt Tp;
StartTop+=MenuV erticalCentered =='bottom'?Size :Size/2}}

function PosMenu(CntnrPn tr,Tp,Lt){
var Topi,Lefti,Hori ;
var Cntnr=CntnrPntr ;
var Mmbr=Cntnr.Frst Mbr;
var CntnrStyle=!Nav 4?Cntnr.style:C ntnr;
var MmbrStyle=!Nav4 ?Mmbr.style:Mmb r;
var PadL=Mmbr.value .indexOf('<')==-1?LftXtra:0;
var PadT=Mmbr.value .indexOf('<')==-1?TpXtra:0;
var MmbrWt=!Nav4?pa rseInt(MmbrStyl e.width)+PadL:M mbrStyle.clip.w idth;
var MmbrHt=!Nav4?pa rseInt(MmbrStyl e.height)+PadT: MmbrStyle.clip. height;
var CntnrWt=!Nav4?p arseInt(CntnrSt yle.width):Cntn rStyle.clip.wid th;
var CntnrHt=!Nav4?p arseInt(CntnrSt yle.height):Cnt nrStyle.clip.he ight;
var SubTp,SubLt;
RcrsLvl++;
if (RcrsLvl==1 && AcrssFrms)!Menu FramesVertical? Tp=FrstWinHght-CntnrHt+(Nav4?4 :0):Lt=RightToL eft?0:FrstWinWd th-CntnrWt+(Nav4?4 :0);
if (RcrsLvl==2 && AcrssFrms)!Menu FramesVertical? Tp=0:Lt=RightTo Left?ScWinWdth-CntnrWt:0;
if (RcrsLvl==2 && AcrssFrms){Tp+= VerCorrect;Lt+= HorCorrect}
CntnrStyle.top= RcrsLvl==1?Tp:0 ;
Cntnr.OrgTop=Tp ;
CntnrStyle.left =RcrsLvl==1?Lt: 0;
Cntnr.OrgLeft=L t;
if (RcrsLvl==1 && FirstLineHorizo ntal){
Hori=1;Lefti=Cn tnrWt-MmbrWt-2*BorderWidth;T opi=0}
else{ Hori=Lefti=0;To pi=CntnrHt-MmbrHt-2*BorderWidth}
while(Mmbr!=nul l){
MmbrStyle.left= Lefti+BorderWid th;
MmbrStyle.top=T opi+BorderWidth ;
if(Nav4)Mmbr.Cm dLyr.moveTo(Lef ti+BorderWidth, Topi+BorderWidt h);
if(Mmbr.ChildCn tnr){
if(RightToLeft) ChldCntnrWdth=N av4?Mmbr.ChildC ntnr.clip.width :parseInt(Mmbr. ChildCntnr.styl e.width);
if(Hori){ SubTp=Topi+Mmbr Ht+2*BorderWidt h;
SubLt=RightToLe ft?Lefti+MmbrWt-ChldCntnrWdth:L efti}
else{ SubLt=RightToLe ft?Lefti-ChldCntnrWdth+C hildOverlap*Mmb rWt+BorderWidth :Lefti+(1-ChildOverlap)*M mbrWt+BorderWid th;
SubTp=RcrsLvl== 1&&AcrssFrms?To pi:Topi+ChildVe rticalOverlap*M mbrHt}
PosMenu(Mmbr.Ch ildCntnr,SubTp, SubLt)}
Mmbr=Mmbr.PrvMb r;
if(Mmbr){ MmbrStyle=!Nav4 ?Mmbr.style:Mmb r;
PadL=Mmbr.value .indexOf('<')==-1?LftXtra:0;
PadT=Mmbr.value .indexOf('<')==-1?TpXtra:0;
MmbrWt=!Nav4?pa rseInt(MmbrStyl e.width)+PadL:M mbrStyle.clip.w idth;
MmbrHt=!Nav4?pa rseInt(MmbrStyl e.height)+PadT: MmbrStyle.clip. height;
Hori?Lefti-=BorderBtwnElmn ts?(MmbrWt+Bord erWidth):(MmbrW t):Topi-=BorderBtwnElmn ts?(MmbrHt+Bord erWidth):(MmbrH t)}}
RcrsLvl--}

function Initiate(){
if(IniFlg){ Init(FrstCntnr) ;IniFlg=0;
if(ShwFlg)After CloseAll();ShwF lg=0}}

function Init(CntnrPntr) {
var Mmbr=CntnrPntr. FrstMbr;
var MCStyle=Nav4?Cn tnrPntr:CntnrPn tr.style;
RcrsLvl++;
MCStyle.visibil ity=RcrsLvl==1? M_Show:M_Hide;
while(Mmbr!=nul l){
if(Mmbr.Hilite) {Mmbr.Hilite=0; if(KeepHilite)L owItem(Mmbr)}
if(Mmbr.ChildCn tnr) Init(Mmbr.Child Cntnr);
Mmbr=Mmbr.PrvMb r}
RcrsLvl--}

function ClearAllChilds( Pntr){
var CPCCStyle;
while (Pntr){
if(Pntr.Hilite) {
Pntr.Hilite=0;
if(KeepHilite)L owItem(Pntr);
if(Pntr.ChildCn tnr){
CPCCStyle=Nav4? Pntr.ChildCntnr :Pntr.ChildCntn r.style;
CPCCStyle.visib ility=M_Hide;
ClearAllChilds( Pntr.ChildCntnr .FrstMbr)}
break}
Pntr=Pntr.PrvMb r}}

function GoTo(){
if(this.LinkTxt ){
status='';
var HP=Nav4?this.Lo wLyr:this;
LowItem(HP);
this.LinkTxt.in dexOf('javascri pt:')!=-1?eval(this.Lin kTxt):DcLoc.loc ation.href=this .LinkTxt}}

function HiliteItem(P){
if(Nav4){
if(P.ro)P.docum ent.images[P.rid].src=P.ri2;
else{ if(P.HiBck)P.bg Color=P.HiBck;
if(P.value.inde xOf('<img')==-1){
P.document.writ e(P.Ovalue);
P.document.clos e()}}}
else{ if(P.ro){ var Lc=P.Level==1?F rstLoc:ScLoc;
Lc.document.ima ges[P.rid].src=P.ri2}
else{ if(P.HiBck)P.st yle.backgroundC olor=P.HiBck;
if(P.HiFntClr)P .style.color=P. HiFntClr}}
P.Hilite=1}

function LowItem(P){
if(P.ro){ if(Nav4)P.docum ent.images[P.rid].src=P.ri1;
else{ var Lc=P.Level==1?F rstLoc:ScLoc;
Lc.document.ima ges[P.rid].src=P.ri1}}
else{ if(Nav4){ if(P.LoBck)P.bg Color=P.LoBck;
if(P.value.inde xOf('<img')==-1){
P.document.writ e(P.value);
P.document.clos e()}}
else{ if(P.LoBck)P.st yle.backgroundC olor=P.LoBck;
if(P.LwFntClr)P .style.color=P. LwFntClr}}}

function OpenMenu(){
if(!Loadd||!Cre atd) return;
var TpScrlld=ExpYes ?ScLoc.document .body.scrollTop :ScLoc.pageYOff set;
var LScrlld=ExpYes? ScLoc.document. body.scrollLeft :ScLoc.pageXOff set;
var CCnt=Nav4?this. LowLyr.ChildCnt nr:this.ChildCn tnr;
var ThisHt=Nav4?thi s.clip.height:p arseInt(this.st yle.height);
var ThisWt=Nav4?thi s.clip.width:pa rseInt(this.sty le.width);
var ThisLft=AcrssFr ms&&this.Level= =1&&!FirstLineH orizontal?0:Nav 4?this.Containe r.left:parseInt (this.Container .style.left);
var ThisTp=AcrssFrm s&&this.Level== 1&&FirstLineHor izontal?0:Nav4? this.Container. top:parseInt(th is.Container.st yle.top);
var HP=Nav4?this.Lo wLyr:this;
CurrntOvr=this;
IniFlg=0;
ClearAllChilds( this.Container. FrstMbr);
HiliteItem(HP);
if(CCnt!=null){
if(!ShwFlg){Shw Flg=1; BeforeFirstOpen ()}
var CCW=Nav4?this.L owLyr.ChildCntn r.clip.width:pa rseInt(this.Chi ldCntnr.style.w idth);
var CCH=Nav4?this.L owLyr.ChildCntn r.clip.height:p arseInt(this.Ch ildCntnr.style. height);
var ChCntTL=Nav4?th is.LowLyr.Child Cntnr:this.Chil dCntnr.style;
var SubLt=AcrssFrms &&this.Level==1 ?CCnt.OrgLeft+T hisLft+LScrlld: CCnt.OrgLeft+Th isLft;
var SubTp=AcrssFrms &&this.Level==1 ?CCnt.OrgTop+Th isTp+TpScrlld:C Cnt.OrgTop+This Tp;
if(MenuWrap){
if(RightToLeft) {
if(SubLt<LScrll d)SubLt=this.Le vel==1?LScrlld: SubLt+(CCW+(1-2*ChildOverlap) *ThisWt);
if(SubLt+CCW>Sc WinWdth+LScrlld )SubLt=ScWinWdt h+LScrlld-CCW}
else{ if(SubLt+CCW>Sc WinWdth+LScrlld )SubLt=this.Lev el==1?ScWinWdth +LScrlld-CCW:SubLt-(CCW+(1-2*ChildOverlap) *ThisWt);
if(SubLt<LScrll d)SubLt=LScrlld }
if(SubTp+CCH>Tp Scrlld+ScWinHgh t)SubTp=this.Le vel==1?SubTp=Tp Scrlld+ScWinHgh t-CCH:SubTp-CCH+(1-2*ChildVertical Overlap)*ThisHt ;
if(SubTp<TpScrl ld)SubTp=TpScrl ld}
ChCntTL.top=Sub Tp;ChCntTL.left =SubLt;ChCntTL. visibility=M_Sh ow}
status=this.Lin kTxt}

function OpenMenuClick() {
if(!Loadd||!Cre atd) return;
var HP=Nav4?this.Lo wLyr:this;
CurrntOvr=this;
IniFlg=0;
ClearAllChilds( this.Container. FrstMbr);
HiliteItem(HP);
status=this.Lin kTxt}

function CloseMenu(){
if(!Loadd||!Cre atd) return;
if(!KeepHilite) {
var HP=Nav4?this.Lo wLyr:this;
LowItem(HP)}
status='';
if(this==Currnt Ovr){
IniFlg=1;
if(CloseTmr)cle arTimeout(Close Tmr);
CloseTmr=setTim eout('Initiate( CurrntOvr)',Dis sapearDelay)}}

function CntnrSetUp(Wdth ,Hght,NoOff){
var x=RcrsLvl==1?Bo rderColor:Borde rSubColor;
this.FrstMbr=nu ll;
this.OrgLeft=th is.OrgTop=0;
if(x)this.bgCol or=x;
if(Nav4){ this.visibility ='hide';
this.resizeTo(W dth,Hght)}
else{ if(x)this.style .backgroundColo r=x;
this.style.widt h=Wdth;
this.style.heig ht=Hght;
this.style.font Family=FontFami ly;
this.style.font Weight=FontBold ?'bold':'normal ';
this.style.font Style=FontItali c?'italic':'nor mal';
this.style.font Size=FontSize+' pt';
this.style.zInd ex=RcrsLvl+Ztop }}

function MbrSetUp(MmbrCn tnr,PrMmbr,What Menu,Wdth,Hght) {
var Location=RcrsLv l==1?FrstLoc:Sc Loc;
var MemVal=eval(Wha tMenu+'[0]');
var t,T,L,W,H,S;
var a,b,c,d;
this.PrvMbr=PrM mbr;
this.Level=Rcrs Lvl;
this.LinkTxt=ev al(WhatMenu+'[1]');
this.Container= MmbrCntnr;
this.ChildCntnr =null;
this.Hilite=0;
this.style.over flow='hidden';
this.style.curs or=ExpYes&&(thi s.LinkTxt||(Rcr sLvl==1&&Unfold sOnClick))?'han d':'default';
this.ro=0;
if(MemVal.index Of('rollover')! =-1){
this.ro=1;
this.ri1=MemVal .substring(MemV al.indexOf(':') +1,MemVal.lastI ndexOf(':'));
this.ri2=MemVal .substring(MemV al.lastIndexOf( ':')+1,MemVal.l ength);
this.rid=WhatMe nu+'i';MemVal=" <img src='"+this.ri1 +"'
name='"+this.ri d+"'>"}
this.value=MemV al;
if(RcrsLvl==1){
a=LowBgColor;
b=HighBgColor;
c=FontLowColor;
d=FontHighColor }
else{ a=LowSubBgColor ;
b=HighSubBgColo r;
c=FontSubLowCol or;
d=FontSubHighCo lor}
this.LoBck=a;
this.LwFntClr=c ;
this.HiBck=b;
this.HiFntClr=d ;
this.style.colo r=this.LwFntClr ;
if(this.LoBck)t his.style.backg roundColor=this .LoBck;
this.style.text Align=MenuTextC entered;
if(eval(WhatMen u+'[2]'))this.style.b ackgroundImage= "url(\'"+eval(W hatMenu+'[2]')+"\')";
if(MemVal.index Of('<')==-1){
this.style.widt h=Wdth-LftXtra;
this.style.heig ht=Hght-TpXtra;
this.style.padd ingLeft=LeftPad dng;
this.style.padd ingTop=TopPaddn g}
else{ this.style.widt h=Wdth;
this.style.heig ht=Hght}
if(MemVal.index Of('<')==-1&&DomYes){
t=Location.docu ment.createText Node(MemVal);
this.appendChil d(t)}
else this.innerHTML= MemVal;
if(eval(WhatMen u+'[3]')&&ShowArrow) {
a=RcrsLvl==1&&F irstLineHorizon tal?3:RightToLe ft?6:0;
S=Arrws[a];
W=Arrws[a+1];
H=Arrws[a+2];
T=RcrsLvl==1&&F irstLineHorizon tal?Hght-H-2:(Hght-H)/2;
L=RightToLeft?2 :Wdth-W-2;
if(DomYes){

t=Location.docu ment.createElem ent('img');
this.appendChil d(t);
t.style.positio n='absolute';
t.src=S;

t.style.width=W ;
t.style.height= H;
t.style.top=T;
t.style.left=L}
else{ MemVal+="<div style='position :absolute; top:"+T+"; left:"+L+";
width:"+W+"; height:"+H+";vi sibility:inheri t'><img src='"+S+"'></
div>";
this.innerHTML= MemVal}}
if(ExpYes){this .onselectstart= CnclSlct;
this.onmouseove r=RcrsLvl==1&&U nfoldsOnClick?O penMenuClick:Op enMenu;
this.onmouseout =CloseMenu;
this.onclick=Rc rsLvl==1&&Unfol dsOnClick&&eval (WhatMenu+'[3]')?OpenMenu:GoT o
}
else{ RcrsLvl==1&&Unf oldsOnClick?thi s.addEventListe ner('mouseover' ,OpenMenuClick, false):this.add EventListener(' mouseover',Open Menu,false);
this.addEventLi stener('mouseou t',CloseMenu,fa lse);
RcrsLvl==1&&Unf oldsOnClick&&ev al(WhatMenu+'[3]')?this.addEven tListener('clic k',OpenMenu,fal se):this.addEve ntListener('cli ck',GoTo,false) }}

function NavMbrSetUp(Mmb rCntnr,PrMmbr,W hatMenu,Wdth,Hg ht){
var a,b,c,d;
if(RcrsLvl==1){
a=LowBgColor;
b=HighBgColor;
c=FontLowColor;
d=FontHighColor }
else { a=LowSubBgColor ;
b=HighSubBgColo r;
c=FontSubLowCol or;
d=FontSubHighCo lor }
this.value=eval (WhatMenu+'[0]');
this.ro=0;
if(this.value.i ndexOf('rollove r')!=-1){
this.ro=1;
this.ri1=this.v alue.substring( this.value.inde xOf(':')+1,this .value.lastInde xOf(':'));
this.ri2=this.v alue.substring( this.value.last IndexOf(':')+1, this.value.leng th);
this.rid=WhatMe nu+'i';this.val ue="<img src='"+this.ri1 +"'
name='"+this.ri d+"'>"}
if(LeftPaddng&& this.value.inde xOf('<')==-1&&MenuTextCent ered=='left')th is.value='&nbsp \;'+this.value;
if(FontBold)thi s.value=this.va lue.bold();
if(FontItalic)t his.value=this. value.italics() ;
this.Ovalue=thi s.value;
this.value=this .value.fontcolo r(c);
this.Ovalue=thi s.Ovalue.fontco lor(d);
this.value=Cntr Txt+"<font face='"+FontFam ily+"'
point-size='"+FontSiz e+"'>"+this.val ue+TxtClose;
this.Ovalue=Cnt rTxt+"<font face='"+FontFam ily+"'
point-size='"+FontSiz e+"'>"+this.Ova lue+TxtClose;
this.LoBck=a;
this.HiBck=b;
this.ChildCntnr =null;
this.PrvMbr=PrM mbr;
this.Hilite=0;
this.visibility ='inherit';
if(this.LoBck)t his.bgColor=thi s.LoBck;
this.resizeTo(W dth,Hght);
if(!AcrssFrms&& eval(WhatMenu+'[2]'))this.backgro und.src=eval(Wh atMenu+'[2]');
this.document.w rite(this.value );
this.document.c lose();
this.CmdLyr=new Layer(Wdth,Mmbr Cntnr);
this.CmdLyr.Lev el=RcrsLvl;
this.CmdLyr.Lin kTxt=eval(WhatM enu+'[1]');
this.CmdLyr.vis ibility='inheri t';
this.CmdLyr.onm ouseover=RcrsLv l==1&&UnfoldsOn Click?OpenMenuC lick:OpenMenu;
this.CmdLyr.onm ouseout=CloseMe nu;
this.CmdLyr.cap tureEvents(Even t.MOUSEUP);
this.CmdLyr.onm ouseup=RcrsLvl= =1&&UnfoldsOnCl ick&&eval(WhatM enu+'[3]')?OpenMenu:GoT o;
this.CmdLyr.Low Lyr=this;
this.CmdLyr.res izeTo(Wdth,Hght );
this.CmdLyr.Con tainer=MmbrCntn r;
if(eval(WhatMen u+'[3]')&&ShowArrow) {
a=RcrsLvl==1&&F irstLineHorizon tal?3:RightToLe ft?6:0;
this.CmdLyr.Img Lyr=new Layer(Arrws[a+1],this.CmdLyr);
this.CmdLyr.Img Lyr.visibility= 'inherit';
this.CmdLyr.Img Lyr.top=RcrsLvl ==1&&FirstLineH orizontal?Hght-Arrws[a+2]-2:(Hght-Arrws[a+2])/2;
this.CmdLyr.Img Lyr.left=RightT oLeft?2:Wdth-Arrws[a+1]-2;
this.CmdLyr.Img Lyr.width=Arrws[a+1];
this.CmdLyr.Img Lyr.height=Arrw s[a+2];
ImgStr="<img src='"+Arrws[a]+"' width='"+Arrws[a+1]+"'
height='"+Arrws[a+2]+"'>";
this.CmdLyr.Img Lyr.document.wr ite(ImgStr);
this.CmdLyr.Img Lyr.document.cl ose()}}

function CreateMenuStruc ture(MName,Numb erOf){
RcrsLvl++;
var i,NoOffSubs,Mbr ,Wdth=0,Hght=0;
var PrvMmbr=null;
var WMnu=MName+'1';
var MenuWidth=eval( WMnu+'[5]');
var MenuHeight=eval (WMnu+'[4]');
var Location=RcrsLv l==1?FrstLoc:Sc Loc;
if (RcrsLvl==1&&Fi rstLineHorizont al){
for(i=1;i<Numbe rOf+1;i++){
WMnu=MName+eval (i);
Wdth=eval(WMnu+ '[5]')?Wdth+eval(WM nu+'[5]'):Wdth+MenuWid th}
Wdth=BorderBtwn Elmnts?Wdth+(Nu mberOf+1)*Borde rWidth:Wdth+2*B orderWidth;Hght =MenuHeight+2*B orderWidth}
else{ for(i=1;i<Numbe rOf+1;i++){
WMnu=MName+eval (i);
Hght=eval(WMnu+ '[4]')?Hght+eval(WM nu+'[4]'):Hght+MenuHei ght}
Hght=BorderBtwn Elmnts?Hght+(Nu mberOf+1)*Borde rWidth:Hght+2*B orderWidth;Wdth =MenuWidth+2*Bo rderWidth}
if(DomYes){
var MmbrCntnr=Locat ion.document.cr eateElement("di v");
MmbrCntnr.style .position='abso lute';
MmbrCntnr.style .visibility='hi dden';
Location.docume nt.body.appendC hild(MmbrCntnr) }
else{ if(Nav4) var MmbrCntnr=new Layer(Wdth,Loca tion)
else{ WMnu+='c';
Location.docume nt.body.insertA djacentHTML("Af terBegin","<div
id='"+WMnu+"' style='visibili ty:hidden; position:absolu te;'><\/div>");
var MmbrCntnr=Locat ion.document.al l[WMnu]}}
MmbrCntnr.SetUp =CntnrSetUp;
MmbrCntnr.SetUp (Wdth,Hght,Numb erOf);
if(Exp4){ MmbrCntnr.Inner String='';
for(i=1;i<Numbe rOf+1;i++){
WMnu=MName+eval (i);
MmbrCntnr.Inner String+="<div id='"+WMnu+"'
style='position :absolute;'><\/div>"}
MmbrCntnr.inner HTML=MmbrCntnr. InnerString}
for(i=1;i<Numbe rOf+1;i++){
WMnu=MName+eval (i);
NoOffSubs=eval( WMnu+'[3]');
Wdth=RcrsLvl==1 &&FirstLineHori zontal?eval(WMn u+'[5]')?eval(WMnu+'[5]'):MenuWidth:Me nuWidth;
Hght=RcrsLvl==1 &&FirstLineHori zontal?MenuHeig ht:eval(WMnu+'[4]')?eval(WMnu+'[4]'):MenuHeight;
if(DomYes){
Mbr=Location.do cument.createEl ement("div");
Mbr.style.posit ion='absolute';
Mbr.style.visib ility='inherit' ;
MmbrCntnr.appen dChild(Mbr)}
else Mbr=Nav4?new Layer(Wdth,Mmbr Cntnr):Location .document.all[WMnu];
Mbr.SetUp=Nav4? NavMbrSetUp:Mbr SetUp;
Mbr.SetUp(MmbrC ntnr,PrvMmbr,WM nu,Wdth,Hght);
if(NoOffSubs) Mbr.ChildCntnr= CreateMenuStruc ture(WMnu+'_',N oOffSubs);
PrvMmbr=Mbr}
MmbrCntnr.FrstM br=Mbr;
RcrsLvl--;
return(MmbrCntn r)}

function CreateMenuStruc tureAgain(MName ,NumberOf){
var i,WMnu,NoOffSub s,PrvMmbr,Mbr=F rstCntnr.FrstMb r;
RcrsLvl++;
for(i=NumberOf; i>0;i--){
WMnu=MName+eval (i);
NoOffSubs=eval( WMnu+'[3]');
PrvMmbr=Mbr;
if(NoOffSubs)Mb r.ChildCntnr=Cr eateMenuStructu re(WMnu+'_',NoO ffSubs);
Mbr=Mbr.PrvMbr}
RcrsLvl--}

function BeforeStart(){r eturn}
function AfterBuild(){re turn}
function BeforeFirstOpen (){return}
function AfterCloseAll() {return}

</script>

</td>
</tr>
</table></center>

<noscript>You r
browser does not support script</noscript>
<!-- REST OF BODY CONTENT BELOW HERE -->
</body>
</html>
Jul 20 '05 #1
1 4326
ajay wrote:
I have following code for a slide menu but i twiked it to work for a
single level menu. Open it in a Browser to get a clear picture.


Good gosh, no. How about a url instead?

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3892
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
9
3334
by: Verona Busch | last post by:
Hi everybody, I am very happy to find this group. I am searching for a solution to make a horizontal list menu with submenu on hover. I found a lot of examples for horizontal lists which open vertical lists on :hover i.e. http://phoenity.com/newtedge/horizontal_nav/ But what I am looking for is a horizontal list that opens another horizontal list and both need to be right-floated.
2
1775
by: SiNi | last post by:
Hello. I am an italian student and I do not known javascript language. I need your help! I have built a web page with frames (left frame and main frame). In the left frames I have attach the code that you find below. I have a problem. because I am not able...when I choose a voice in the menu, the relative web page open in the left menu....where there is the menu; but
4
9292
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me if it works, and if it does not, tell me why it does not work. Thanks.
1
3454
by: mikeguy3086 | last post by:
Here is what I'm trying to achieve: I'm making a site that is basically a big slide show which is insignificant, but it has to be really minimalistic. So what I did was make an invisible button that is over the entire 900x400 rectangle. Basically what I want and as far as I got was getting it so that when you scroll over the button, the blank menu drops down. And when you scroll off it retracts and goes back up. Here is my code //this is...
0
3139
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of the browsers I have tested it on (IE6, IE7, Firefox, Opera and Safari). It is probably something simple, but I can't find it! Here is the CSS (using external style sheets): style-temp.css (Main style sheet for the site): * { font-family:...
5
2608
by: mukeshrasm | last post by:
hello friends I am new to javascript and I have a problem. I am giving the code <!-- Paste this code into the CSS section of your HTML document --> <html> <head> <style type="text/css"> .menu { position:relative; background-color:gold;
7
1857
by: Joe | last post by:
usually slide bars move by "jumps" while scrolling which looks not nice. I came accress slide bar with price menu, ewnt through script/web source code, and could not find anything that would case that wanted effect :) here you go: http://www.shopping.hp.com/webapp/shopping/computer_can_series.do?storeName=computer_store&category=notebooks&a1=Display&v1=20.1&series_name=HDX_series&a1=Display&v1=20.1 click on the left >Recommended config...
0
8743
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9239
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7844
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2424
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2055
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.