Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Collapsing Menu on column_left


native

Recommended Posts

Posted

Hey,

 

I am a newbie (with a tiny bit of php experience) and have been working for a week on just getting the menu for my store to work the way I want it to. After programming with javascript and setting up column_left it wasn't expanding/contracting correctly when my page loaded via index.php. So I read some posts that advised against using javascript. I spent the past day working on the menu with CSS and it works fine outside of index.php but when column_left loads from index.php it is not working. Please bear in mind that I do not have these buttons doing anything at the moment instead of expanding/contracting -- I am planning on adding the code once they function properly. Can anyone tell me what I am doing wrong, or give me some advice about what I should do next? I was going to work on boxes but haven't worked with them before so I thought this would be an easier way for me to get the menu that I want.

 

My website is www.native-treasures.org. When you pull it up, you will see that only one button is appearing. If you click on it, the rest of the buttons will show up underneath. I copied the exact same code to a file (which you can bring up on my website) titled testmenu.htm and you can see how it is supposed to work. My code is below. Please let me know what I am missing.

 

<?php

/*

$Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>Native Treasures ... Communicating Culture Through Art</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

 

 

<style type="text/css">

BODY {

font-family: "Papyrus", "Arial", sans-serif;

}

 

UL {

cursor: hand;

}

 

UL LI {

display: none;

font: 90%;

list-style-type: none;

font-family: "Papyrus", "Arial", sans-serif;

font-weight: bold;

font-size: 11px;

margin-left: 3px;

}

 

UL.showList LI {

display: block;

text-align: left;

}

 

.defaultStyles UL {

color: black;

}

 

UL.defaultStyles LI {

display: none;

}

 

</STYLE>

</head>

 

<BODY onselectstart="event.returnValue=false;" >

 

<UL ID="bycat" onclick="this.className='showList'; byctry.className='defaultStyles'; giftidea.className='defaultStyles';"

ondblclick="this.className='defaultStyles';"

onmouseover="document.catimg.src='rshopcat.gif';"

onmouseout="document.catimg.src='yshopcat.gif';">

<A HREF="#"><IMG NAME="catimg" SRC="yshopcat.gif" width=110 height=49></A>

<li><a href="#">Accessories</a></li>

<li><a href="#">Artwork</a></li>

<li><a href="#">Christmas</a></li>

<li><a href="#">Clothing</a></li>

<li><a href="#">Games & Toys</a></li>

<li><a href="#">Instruments</a></li>

<li><a href="#">Jewelry</a></li>

<li><a href="#">Pottery</a></li>

<li><a href="#">Sculptures & Carvings</a></li>

<li><a href="#">Tapestries & Linens</a></li>

<li><a href="#">Everything Else</a></li>

</UL>

 

<UL ID="byctry" onclick="this.className='showList'; bycat.className='defaultStyles'; giftidea.className='defaultStyles';"

ondblclick="this.className='defaultStyles';"

onmouseover="document.ctryimg.src='rshopcountry.gif';"

onmouseout="document.ctryimg.src='yshopcountry.gif';">

<A HREF="#"><IMG NAME="ctryimg" SRC="yshopcountry.gif" width=110 height=49></A>

<li><a href="#">Argentina</A></li>

<li><a href="#">Bangladesh</A></li>

<li><a href="#">Benin</A></li>

<li><a href="#">Bolivia</A></li>

<li><a href="#">Bosnia-Herzegovina</A></li>

<li><a href="#">Burkina Faso</A></li>

<li><a href="#">Cambodia</A></li>

<li><a href="#">Cameroon</A></li>

<li><a href="#">Chili</A></li>

<li><a href="#">China</A></li>

<li><a href="#">Ecuador</A></li>

<li><a href="#">Egypt</A></li>

<li><a href="#">El Salvador</A></li>

<li><a href="#">Ethiopia</A></li>

<li><a href="#">Ghana</A></li>

<li><a href="#">Guatemala</A></li>

<li><a href="#">Haiti</A></li>

<li><a href="#">Honduras</A></li>

<li><a href="#">India</A></li>

<li><a href="#">Indonesia</A></li>

<li><a href="#">Israel</A></li>

<li><a href="#">Kenya</A></li>

<li><a href="#">Laos</A></li>

<li><a href="#">Mexico</A></li>

<li><a href="#">Nepal</A></li>

<li><a href="#">Nicaragua</A></li>

<li><a href="#">Niger</A></li>

<li><a href="#">Nigeria</A></li>

<li><a href="#">Pakistan</A></li>

<li><a href="#">Peru</A></li>

<li><a href="#">Philippines</A></li>

<li><a href="#">Senegal</A></li>

<li><a href="#">South Africa</A></li>

<li><a href="#">Sri Lanka</A></li>

<li><a href="#">Tanzania</A></li>

<li><a href="#">Thailand</A></li>

<li><a href="#">Turkey</A></li>

<li><a href="#">Uganda</A></li>

<li><a href="#">United States</A></li>

<li><a href="#">Vietnam</A></li>

<li><a href="#">West Bank</A></li>

</UL>

 

<UL ID="giftidea" onclick="this.className='showList'; bycat.className='defaultStyles'; byctry.className='defaultStyles';"

ondblclick="this.className='defaultStyles';"

onmouseover="document.ideaimg.src='rideas.gif';"

onmouseout="document.ideaimg.src='yideas.gif';">

<A HREF="#"><IMG NAME="ideaimg" SRC="yideas.gif" width=110 height=49></A>

<li><a href="#">Birthday</a></li>

<li><a href="#">For Her</a></li>

<li><a href="#">For Him</a></li>

<li><a href="#">For Kids</a></li>

<li><a href="#">Housewarming</a></li>

<li><a href="#">Romantic</a></li>

<li><a href="#">Wedding</a></li>

<li><a href="#">Under $25</a></li>

<li><a href="#">Under $50</a></li>

</UL>

 

</body>

</html>

Posted

to begin with you have a 2nd body/head etc tags on your index page because you simply copied the entire html page.

 

Try to correct that. It causes all sorts of unpredictable results. You should add the event value to the existing <body> tag of your index.php file

Posted

Thanks enigma for pointing out what should have been obvious to me -- too many hours of no sleep and staring at the monitor!! :blush: I fixed it and am still having the same problem. Let me know if you see any other dumb mistakes!

Posted

check the html table tags around your code in the body. There is a table

<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="125" valign="top"><table border="0" width="125" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->

 

but look how it terminates just after your code:

<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->

 

should been </td></tr></table>

Posted

:thumbsup: Mark, you are awesome! I hadn't changed any of the table info in index.php when I changed column_left because I didn't see any table entries in column_left -- I should have looked inside the box files. I eliminated the extra table entry and "TADA!" it works! I am so happy to move beyond this now!!!! Thanks for being so quick at finding my mistakes!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...