...

View Full Version : 2 Java Menus on same Page



Switch17
01-14-2004, 09:41 PM
Hi,

I'm trying to place 2 slide in menu's on the same page. There the same scripts, in which I've just changed the names of the files for each. The both work independtly, but when I try to put them both on the same page, I can't seem to get it to work. I'm trying to create a few slide in menu's for different topics.

The code for one menu looks like this:
<html>
<head>
<STYLE><!--
A.ssmItems:link {color:black;text-decoration:none;}
A.ssmItems:hover {color:black;text-decoration:none;}
A.ssmItems:active {color:black;text-decoration:none;}
A.ssmItems:visited {color:black;text-decoration:none;}
//-->
</STYLE>
<SCRIPT SRC="menu_files/front_office_ssm.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT SRC="menu_files/front_office_items.js" language="JavaScript1.2"></SCRIPT>
</head>

<body>
<SCRIPT SRC="front_office_ssm.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT SRC="front_office_items.js" language="JavaScript1.2"></SCRIPT>
</body>

</html> and the other one is almost identical, just different file names.
<html>
<head>
<STYLE><!--
A.ssmItems:link {color:black;text-decoration:none;}
A.ssmItems:hover {color:black;text-decoration:none;}
A.ssmItems:active {color:black;text-decoration:none;}
A.ssmItems:visited {color:black;text-decoration:none;}
//-->
</STYLE>
<SCRIPT SRC="menu_files/weekly_reports_ssm.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT SRC="menu_files/weekly_reports_items.js" language="JavaScript1.2"></SCRIPT>
</head>

<body>
<SCRIPT SRC="weekly_reports_ssm.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT SRC="weekly_reports_items.js" language="JavaScript1.2"></SCRIPT>
</body>

</html>

So what do you have to do put the two together?

glenngv
01-15-2004, 06:17 AM
This type of questions are asked several times in this forum. If you search this forum, you'll find plenty of results (http://www.codingforums.com/search.php?s=&action=showresults&searchid=204151&sortby=lastpost&sortorder=descending)

Switch17
01-15-2004, 02:02 PM
Thanks for pointing me in the right direction. I'm a newbie to java and for some reason, just didn't think to hit the search button and look for an answer. My bad, I should have known better, as I mod on some other type of boards out there.

glenngv
01-19-2004, 05:30 AM
And another thing, Java is different with Javascript.

Switch17
01-23-2004, 08:50 PM
OK, I'm back to reading and trying to learn how to get the same script to work twice on the same page. Javascript is all new to me. I'm reading on how I need to avoid an onload confict, and possible call each function separately. However, I'm a little confusd as to how this is exactly done. When I look at the code of the script, I actually do not see any onload commands at all, but only various functions. Are these the same thing?

I'm trying to put this slidein menu Here (http://simplythebest.net/info/dhtmscript54.html) on the same page twice. One beneath the other. A piece of the ssm.js file looks like such:
///// SLIDE FUNCTION //////
moving=setTimeout('null',1)
function moveOut() {
if ((NS6 && parseInt(ssm.left)<0)||(IE && ssm.pixelLeft<0)||(NS && ssm.left<0)) {
clearTimeout(moving);moving = setTimeout('moveOut()', slideSpeed)
if (NS6) {theleft+=10;ssm.left = theleft;}
if (IE) {ssm.pixelLeft += 10;}
if (NS) {ssm.left += 10;ssm.clip.left-=10}}
else {clearTimeout(moving);moving=setTimeout('null',1)}};
function moveBack() {
clearTimeout(moving);moving = setTimeout('moveBack1()', waitTime)}
function moveBack1() {
if ((NS6 && parseInt(ssm.left)>(-menuWidth))||(IE && ssm.pixelLeft>(-menuWidth))||(NS && ssm.left>(-menuWidth))) {
clearTimeout(moving);moving = setTimeout('moveBack1()', slideSpeed);
if (NS6) {theleft-=10;ssm.left = theleft;}
if (IE) {ssm.pixelLeft -= 10;}
if (NS) {ssm.left -= 10;ssm.clip.left+=10}}
else {clearTimeout(moving);moving=setTimeout('null',1)}};


Again, thats only a piece of the code, and is the first function called in the script. Do I need to change each function somehow? Agian, I'm very new to Javascript, so any help would be great.

Switch17
02-09-2004, 05:21 PM
I found some free time this weekend to continue on trying to place the two slide-in menu's on the same page, and seem to be struggling a bit. I know each menu works separately, and I believe I've changed each menu to avoid any conflicts, and then call all the onloads in the body, but still can't get it quite right.

If anyone has the time, do you think you could take a look at the code on my test3.html file? You'll see a blank page, but you can view the code if you'd like. I figured that may be easier than trying to view the code in forum.


Test1 (http://www.freedffl.com/football/test.html) Menu 1 Working
Test2 (http://www.freedffl.com/football/test2.html) Menu 2 Working

Test3 (http://www.freedffl.com/football/test3.html) Menu Combined, and not working

glenngv
02-10-2004, 02:35 AM
The slide-in menu script is supposed to work as only one slide-in menu in a page. Why would you need 2 slide-in menus? Normally, you have only one menu and just organized the items by separating them by headers (Menu, External Links in your sample).

Switch17
02-10-2004, 10:07 PM
My existing menu system is segrated into 4 main catgories as such:

Front Office
Weekly Reports
Seasonal Reports
All Time Records

And each category includes 7 or 8 links or so. I'm hoping to create a slide-in menu for each category, to take advantage of the space they take up.

I know I could just make one really big slide in menu, but I believe it would look much better as 4 separate menu's, with each menu labeled appropriately.

glenngv
02-11-2004, 01:57 AM
That slide-in menu script is not suited for your needs. Use other menu scripts like this one (http://www.codingforums.com/showthread.php?s=&threadid=31904).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum