Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 2 Java Menus on same Page

    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:
    Code:
    <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.
    Code:
    <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?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    This type of questions are asked several times in this forum. If you search this forum, you'll find plenty of results

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    And another thing, Java is different with Javascript.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 on the same page twice. One beneath the other. A piece of the ssm.js file looks like such:
    Code:
    ///// 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.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 Menu 1 Working
    Test2 Menu 2 Working

    Test3 Menu Combined, and not working

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    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).

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    That slide-in menu script is not suited for your needs. Use other menu scripts like this one.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •