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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu prob in NN4.x 1

Status
Not open for further replies.

JimJx

Technical User
Feb 16, 2001
202
US
Hi all,

I DLd SlideMenu2 from DHTMLCentral and am trying to do some (what I thought were easy) mods. Ihave ran into a problem and have asked for help there, but never get a response.

This works fine in IE 5.5 and NN7. However, in NN4 I get the error "document.divSlideCont.document.layers.divSlide1 has no properties".

If I remove the line <DIV id=&quot;divSlide0&quot; CLASS=&quot;MenuTop&quot;> then I don't get the error, but is also doesn't display properly in any browser. Can anyone spot the problem?

Everything looks right to me, so any help would be greatly appreciated.
Jim


The script that writes all of this out is:
Code:
menus=new Array(); var a=0; var b=0; var c=0; var d=0
function makeMenu(type,text,lnk,target,end){
	str=&quot;&quot;; tg=&quot;&quot;;
  if(target) tg='target=&quot;'+target+'&quot;'
  if(!lnk) lnk=&quot;#&quot;
  //self.status=lnk
	if(a==0) str='<div id=&quot;divSlideCont&quot;>\n';
	if(type==&quot;top&quot;){
		menus[a]=new Array();
		if(text==&quot;seperator&quot;){
		str+='\t<div id=&quot;divSlide'+a+'&quot; class=&quot;clSlideLogo&quot;><DIV id=&quot;divSlide'+a+'&quot; CLASS=&quot;LogoTop&quot;><img src=&quot;images/rcdsmall2.png&quot;></DIV>\n</div>\n<DIV id=&quot;divSlide'+a+'&quot; CLASS=&quot;MenuTop&quot;>\n'
			menus[a].seperator=1
		}else{
		//MOD03: replace onclick with onmouseover in the next line to make the menu unfold onmouseover
      str+='\t<div id=&quot;divSlide'+a+'&quot; class=&quot;clSlide&quot;><a href=&quot;'+lnk+'&quot; '+tg+' onclick=&quot;swmenu('+a+',-1,-1); if(bw.ie || bw.ns6) this.blur(); '
      if(lnk==&quot;#&quot;) str+='return false'
      str+='&quot; class=&quot;clSlideLinks&quot;> '+text+'</a><br></div>\n'
		}
    menus[a].subs=0; a++; b=0
	}else if(type==&quot;sub&quot;){

		//MOD01: routine to mark sub if link matches current page
		var cls='clSlideSubLinks';
		if(lnk==url || lnk==page){
			arr[arr.length]=a-1;
			cls='clSlideSubHilite';
			menus[0].hi=b;
		}

		//MOD03: replace onclick with onmouseover in the next line to make the menu unfold onmouseover
		str+='\t\t<div id=&quot;divSlideSub'+(a-1)+'_'+b+'&quot; class=&quot;clSlideSub&quot;><a '+tg+' onclick=&quot;swmenu('+(a-1)+','+b+',-1); if(bw.ie || bw.ns6) this.blur(); '
    if(lnk==&quot;#&quot;) str+='return false'
    str+='&quot; href=&quot;'+lnk+'&quot; class=&quot;'+cls+'&quot;>  '+text+'</a><br></div>\n'
		b++; menus[a-1].subs=b; menus[a-1][b-1]=new Array(); c=0; menus[a-1][b-1].subs=0
	}else if(type==&quot;sub2&quot;){

		//MOD01: routine to mark sub2 if link matches current page
		var cls='clSlideSub2Links';
		if(lnk==url || lnk==page){
			arr[arr.length]=a-1;
			arr[arr.length]=b-1;
			cls='clSlideSub2Hilite';
			menus[0].hi=c;
		}

		str+='\t\t<div id=&quot;divSlideSub'+(a-1)+'_'+(b-1)+'_'+c+'&quot; class=&quot;clSlideSub2&quot;><a '+tg+' href=&quot;'+lnk+'&quot; class=&quot;'+cls+'&quot;>  '+text+'</a><br></div>\n'
		c++; menus[a-1][b-1].subs=c; menus[a-1][b-1][c-1]=new Array(); d=0; menus[a-1][b-1][c-1].subs=0
	}
	if(type==&quot;end&quot;) str+=&quot;</div>\n</div>\n&quot;
	document.write(str)
}

And the output in NN4 when you view source for the page is:
Code:
<DIV id=&quot;divSlideCont&quot;>
        <DIV id=&quot;divSlide0&quot; class=&quot;clSlideLogo&quot;><DIV id=&quot;divSlide0&quot; CLASS=&quot;LogoTop&quot;><IMG src=&quot;images/rcdsmall2.png&quot;></DIV>
</DIV>
<DIV id=&quot;divSlide0&quot; CLASS=&quot;MenuTop&quot;>
        <DIV id=&quot;divSlide1&quot; class=&quot;clSlide&quot;><A href=&quot;index.html&quot;  onclick=&quot;swmenu(1,-1,-1); if(bw.ie || bw.ns6) this.blur(); &quot; class=&quot;clSlideLinks&quot;> Home</A><BR></DIV>
        <DIV id=&quot;divSlide2&quot; class=&quot;clSlide&quot;><A href=&quot;#&quot;  onclick=&quot;swmenu(2,-1,-1); if(bw.ie || bw.ns6) this.blur(); return false&quot; class=&quot;clSlideLinks&quot;> Portfolio</A><BR></DIV>
                <DIV id=&quot;divSlideSub2_0&quot; class=&quot;clSlideSub&quot;><A  onclick=&quot;swmenu(2,0,-1); if(bw.ie || bw.ns6) this.blur(); &quot; href=&quot;webportfolio.html&quot; class=&quot;clSlideSubLinks&quot;>  Web Portfolio</A><BR></DIV>
                <DIV id=&quot;divSlideSub2_1&quot; class=&quot;clSlideSub&quot;><A  onclick=&quot;swmenu(2,1,-1); if(bw.ie || bw.ns6) this.blur(); &quot; href=&quot;printportfolio.html&quot; class=&quot;clSlideSubLinks&quot;>  Print Portfolio</A><BR></DIV>
        <DIV id=&quot;divSlide3&quot; class=&quot;clSlide&quot;><A href=&quot;aboutus.html&quot;  onclick=&quot;swmenu(3,-1,-1); if(bw.ie || bw.ns6) this.blur(); &quot; class=&quot;clSlideLinks&quot;> About Us</A><BR></DIV>
</DIV>
</DIV>

And finally, the CSS that backs all of this up is:
Code:
#divSlideCont {
    HEIGHT: 350px; 
    LEFT: 0px; 
    POSITION: absolute; 
    TOP: 100px; 
    VISIBILITY: hidden; 
    WIDTH: 150px; 
    Z-INDEX: 10
}
DIV.clSlide {
	CLIP: rect(0px 138px 22px 0px); 
    HEIGHT: 22px; 
    LEFT: 0px; 
    PADDING-BOTTOM: 3px; 
    PADDING-LEFT: 3px; 
    PADDING-RIGHT: 3px; 
    PADDING-TOP: 3px; 
    POSITION: absolute; 
    WIDTH: 138px; 
    Z-INDEX: 10
}

DIV.clSlideLogo {
	CLIP: rect(0px 138px 150px 0px); 
    HEIGHT: 22px; 
    LEFT: 0px; 
    PADDING-BOTTOM: 3px; 
    PADDING-LEFT: 3px; 
    PADDING-RIGHT: 3px; 
    PADDING-TOP: 3px; 
    POSITION: absolute; 
    WIDTH: 138px; 
    Z-INDEX: 10
}

DIV.clSlideSub {
	CLIP: rect(0px 127px 20px 0px); 
    HEIGHT: 20px; 
    LEFT: 8px; 
    PADDING-BOTTOM: 2px; 
    PADDING-LEFT: 2px; 
    PADDING-RIGHT: 2px; 
    PADDING-TOP: 2px; 
    POSITION: absolute; 
    VISIBILITY: hidden; 
    WIDTH: 127px; 
    Z-INDEX: 10
}

.MainContent {
POSITION: absolute;
LEFT: 150px;
}

.MenuTop {
Position: absolute;
Top: 85;
Left: 5px;
}

.LogoTop {
Position: relative;
Top: 5;
Left: 5px;
}
 
Thanks for the response Gary. But, that solution is not reasonable to me for several reasons.

1) This is the basis for something that will be placed on an intranet with about 60% NN4 users.

2) The script worked fine before I did the mods in ALL browsers I check in, so I know that it can work. It is just a matter of finding the offending code.

 
Jim,

I'm really serious. Netscape 4 cannot handle what you are asking it to handle.

Not only does the CSS code you feed it too advanced for it but the Javascript is too advanced as well.

Perhaps you could make the intranet really simple if people cannot use anything else. You can tell them that Netscape 6-7 is free.

I'm sorry to be the bearer of bad news but forget about using this script if your audience is reluctant upgraders set on using NN4.

good luck Gary Haran
 
JimJx -

Gary is right - NN4 is just too old to support the code you've posted. In all reality, Nescape 7 actually works better, and is faster, than NN4. Even on older systems. You're 60% NN4 users represent the EXTREMELY small number of worldwide NN4 users.

And as Gary points out, the upgrade is 100% free, besides being very easy to install.

Trust Gary, and me, you and you're clinets will be a lot happier! There's always a better way...
 
Thanks again for the input, but I have to disagree. :)

If you go here http://www.dhtmlcentral.com/script/ and click on &quot;View Demo&quot; under SlideMenu2 you will see the script I am using. I have done very little in the way of mods, except for adding a logo at the top of the menu.

The way I see it, and this is my opinion only of course, is that if the author of this got it to work, adding the graphic should work also.

It is a very nice script, very well commented and easy to follow. The only problem that I am having is something in the CSS or script. Instead of getting the menu links under the logo graphic, they show up on top, or not at all.

I am going to try to contact the author again, but if any one has any more ideas, opinions or whatever please don't hesitate, even if you just want to tell me that I'm crazy for trying to mod this. :)

Thanks!
Jim
 
Hello again all,
Just thought I would stop in and give an update. I got it to work in NN4!!!!!

I also tested in Opera 7, IE 5.5, and NN7 and everything appears to work.

I had to bascially do a rewrite of the first section of code that begins with
Code:
if(!lnk) lnk=&quot;#&quot;
above, but once I changed the logic around it worked great. I still hate working with other people's code, and am thinking about doing a rewrite when I get some time.....

Anyway, if anyone would like to check it out, you can go to and see the menu in action. One word of caution though, I have spent most of my free time on this script (not to mention that my wife hasn't given me the complete layout that she wants yet) and the only page that is completed is the index.

But, when you get there, click on the Portfolio link and you will see how the slide works. Also, if you scroll the page down, the menu will scroll to position to stay visible.

Thanks again for all of the suggestions.
Jim
 
a star to Jim for showing me I was wrong about NS4.


However I still think the efforts were useless. Most of the time trying to support NS4 results in 4 times more effort spent on the complete site. Gary Haran
 
Well, after a while it definitely became a quest..... IMHO, the search for knowledge is NEVER useless. I am much better at JS now, I think, for having done this.

It was definitely an excellent learning experience. And that will help me in other projects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top