Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script problem 1

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hi everyone, I've got a dilemma...i'm desinging a site for a client and i've come across a problem. I have a menu on the left-side of the browser. The problem is that for some reason the first five menu choices don't appear, it displays from the sixth menu choice. There are about 31 menu choices. I can't figure out why the first 5 menu choices get cut off. Also, the menu appears at the top of the page, and I would like it to appear at the middle, the same way the links on the right side of the page are displayed. I know this script works for both IE and NS but when the menu choices are this many, it doesn't work in NS, why?
Any help is much much appreciated. Thanks in advance!

I uploaded the page at this site:
I have not failed; I merely found 100,000 different ways of not succeding...
 
GUJUmOdeL,

...working out your script...its extensive...i have found so far that it is including your top 5...just displaying them above the page.... still diggin fer why ... Hope it helps ;)

~ jsLove
 
ha!

here ya go:

var ChildOverlap=0;
var ChildVerticalOverlap=.1;
var StartTop=0; //set vertical offset
var StartLeft=0; //set horizontal offset
var VerCorrect=0;
var HorCorrect=1;
var LeftPaddng=3;

in the examplevar.js ...change this number to dictate where from the top you would like the menu to start...higher is lower on the screen ;)

i set it to 150 and could see all your tabs ;)


...also...your arrays that hold the tab and subtab info are not all the same width? just in case it matters to ya ;)

Hope it helps ;)

~ jsLove
 
hmm...

would also fix this:

var MenuCentered='left';
var MenuVerticalCentered='left'; this should say top

still having dificulties getting your sub menus to appear where they should...after about the 16th tab they maintain thier position instead of appearing next to the tab...hmmm Hope it helps ;)

~ jsLove
 
Hey, jsLove, it worked! And you're right about the sub-menus, I hadn't even noticed that. You have any suggestions about why that happens?? Or any ideas??
Thanks... I have not failed; I merely found 100,000 different ways of not succeding...
 
GUJUm0deL,

...im lookin....needle in a haystack ... Hope it helps ;)

~ jsLove
 
GUJUm0deL,

ha! i think i may have found it...

look at this from your menu_com.js file:

function CalcTop(){
var Size=FirstWindowHeight;
if(MenuVerticalCentered!='top'){
StartTop=M_StartTop;
Size-=(FirstLineHorizontal)?(eval('Menu1[3]')+BorderWidth):(NoOffFirstLineMenus*(eval('Menu1[3]')+BorderWidth)+BorderWidth);
if(MenuVerticalCentered=='bottom')StartTop+=Size; else StartTop+=Size/2}}

...i have opened it in different windows, some smaller, some larger, and what is happening is the submenus will only go down as far as the original window allows... i had thought before that it was a number thing, so that was what i was lookin for, but on trying it in a larger window, more menus acted properly ...so...we may try altering this...tho i havent tried it yet...but at least i think im on the right track
Hope it helps ;)

~ jsLove
 
Hey jsLove, would something like: window.document.height work?? If I changed 'var Size=FirstWindowHeight;' to
var Size=window.document.height; work?? Would I have to change anything in the function or the script?? Does the 'window.document.height' work for both IE and NS??
Thanx... I have not failed; I merely found 100,000 different ways of not succeding...
 
hi
GUJU, window.document.height is for nc only.. regards, vic
 
GUJUm0deL,

thx for the vote ;)

...about to try that on my copy...if it does, the window.document.height will need to be put in several places in the menu_com.js... the "FirstWindowHeight" variable is used extensively in the script....

i'll let ya know what happens hehe ;) Hope it helps ;)

~ jsLove
 
well window.document.height doesn't work...in NS ..in fact in NS, the menu doesn't even show up anymore...but in IE, the sub-menu still shows up in the middle... I have not failed; I merely found 100,000 different ways of not succeding...
 
i think we may need to set a specific hieght...but not sure where yet...its calling variable from earlier on in the script, and it's used in many places...have to be careful of which one is actually adjusting the hieght for the submenus...

this script is a bit over my head...any ideas vitus? Hope it helps ;)

~ jsLove
 
jsLove, you're welcome about the vote...:)

I tried the window.document.height and nothing happened...and vituz just told me that window.document.height works for NS only...
Also wouldn't setting a specific height mean that any window with another height, it wouldn't work right??
I'm open to any ideas...
Thanx... I have not failed; I merely found 100,000 different ways of not succeding...
 
PS - i'm willing to try adding a specific size... I have not failed; I merely found 100,000 different ways of not succeding...
 
GUJUm0deL,

okay, so the document.height idea is out...

setting a specific height only in the instance of the submenus would not be bad...we would add a variable to the variable script, and it would only effect the submenu...
like, you have 31 subs, each at 20px high=620px plus the 2 or so px offset...this would make the subs independent of the window size... the dirty is finding where to plug in the variable so that it doesnt mess up the rest of the code.. Hope it helps ;)

~ jsLove
 
Hey jsLove, that is a dirty deed, i'm also trying to find out where we can add the specific height...lemme know if you have any luck ok?? I have not failed; I merely found 100,000 different ways of not succeding...
 
GUJUm0deL,

you got it, still combing thru the code... Hope it helps ;)

~ jsLove
 
I don't know if this helps any but, 'FirstWindowHeight' appears only twice. Once at the top where everything is declared and again in the function CalcTop...what I tried to do was set
'FirstWindowHeight' to 620 pixels in the function CalcTop, and have 'FirstWindowHeight' set to var size...but that didn't work... I have not failed; I merely found 100,000 different ways of not succeding...
 
GUJUm0deL,

actually, i found "FirstWindowHeight" 4 times in the menu_com.js ...one set at the top is for ie and one is for ns, then twice at the bottom...the submenus are created layers held in a container...but the script uses many containers...the trick is to tell the submenu container to be a specific hieght...not the subs themselves...

..still diggin Hope it helps ;)

~ jsLove
 
GUJUm0deL,

OMG i think i have it!

find this function in your menu_com.js :

function OpenMenu(){
if(!Loaded||!Created) return;
var TopScrolled=(AcrossFrames)?(ExpYes)?SecLocation.document.body.scrollTop:SecLocation.pageYOffset:0;
var LeftScrolled=(AcrossFrames)?(ExpYes)?SecLocation.document.body.scrollLeft:SecLocation.pageXOffset:0;
var ChildCont=(Nav4)?this.LowLyr.ChildCntnr:this.ChildCntnr;
var ThisHeight=(Nav4)?this.clip.height:parseInt(this.style.height);
var ThisWidth=(Nav4)?this.clip.width:parseInt(this.style.width);
CurrentOver=this; InitFlag=0;
if(ShowFlag){
ClearAllChilds(this.Container.FirstMember,ChildCont);
if(this.Level==1) ShowFlag=0}
if(Nav4){ if(this.LowLyr.value.indexOf('<img')==-1){
this.LowLyr.bgColor=this.LowLyr.HighBack;
this.LowLyr.document.write(this.LowLyr.Overvalue);
this.LowLyr.document.close()}}
else{ this.style.backgroundColor=this.HighBack;
this.style.color=this.HighFontColor}
if(ChildCont!=null) {
var ChildContWidth=(Nav4)?this.LowLyr.ChildCntnr.clip.width:parseInt(this.ChildCntnr.style.width);
var ChildContHeight=(Nav4)?this.LowLyr.ChildCntnr.clip.height:parseInt(this.ChildCntnr.style.height);
var ChCntTL=(Nav4)?this.LowLyr.ChildCntnr:this.ChildCntnr.style;
var SubLt=ChildCont.OrgLeft+LeftScrolled;
var SubTp=ChildCont.OrgTop+TopScrolled;
while(SubLt+ChildContWidth>SecWindowWidth+LeftScrolled){
if(this.Level==1)SubLt=SecWindowWidth+LeftScrolled-ChildContWidth;
else SubLt-=10}
---------------------------------
New:
while(SubTp+ChildContHeight>1200){
if(this.Level==1)SubTp=TopScrolled+SecWindowHeight-ChildContHeight;
else SubTp-=10}

Old:
//while(SubTp+ChildContHeight>TopScrolled+SecWindowHeight){
//if(this.Level==1)SubTp=TopScrolled+SecWindowHeight-ChildContHeight;
//else SubTp-=10}
-------------------------------

ChCntTL.top=SubTp;
ChCntTL.left=SubLt;
ChCntTL.visibility=M_Show;
ShowFlag=1}
status=this.LinkTxt}


(jsLove does a jig) Hope it helps ;)

~ jsLove
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top