Good morning cpradio
I have installed the dcAccordion plugin (the No 1 version). But, before I show all my code (because there is so much of it, not because it is a secret) I wonder if I have discovered the problem.
I said last night that everything was controlled by one index.php file. Well, I have just realised that is not quite true. The Home page (which, of course is part of the navigation) has its own index.php file. Could this be causing the problem? I have linked the plugin’s js files and put the setup function into the head of both index.php files, but could there be some confusion being caused there. If you think not, then I will paste all my code, which I assume will be my two index.php file, the css file. and the nav.php which holds the navigation and is included into both index.php files.
Actually, I have decided to include all the files. It is not working properly. If I click the One of the pages with a slideDown submenu it doesn’t slide down. If I click on the Home page, then try one of the slideDown menus again, it does work. But only once, until I select the Home page again. So here is all the code:
nav.php:
<nav>
<ul class="menu">
<li><a href="/"><span class="menuBut">Home</span></a></li>
<li><a href="#"><span class="menuBut">Coffees</span></a>
<ul>
<li class="dcjq-current-parent"><a href="/pages/?cat=1&subcat=all_coffees"><span>▸</span> All Coffees</a></li>
<li><a href="/pages/?subcat=DA"><span>▸</span> Dandelion</a></li>
<li><a href="/pages/?subcat=BU"><span>▸</span> Dandelion & Burdock</a></li>
<li><a href="/pages/?subcat=CY"><span>▸</span> Chicory</a></li>
<li><a href="/pages/?subcat=RM"><span>▸</span> Roasted Malt</a></li>
<li><a href="/pages/?subcat=CO"><span>▸</span> Chinnoh</a></li>
<li><a href="/pages/?subcat=YA"><span>▸</span> Yannoh</a></li>
<li><a href="/pages/?subcat=FC"><span>▸</span> French Coffee</a></li>
<li><a href="/pages/?subcat=CODA"><span>▸</span> Comfrey & Dandelion</a></li>
<li><a href="/pages/?subcat=*substitute"><span>▸</span> Why a Coffee Substitute</a></li>
</ul>
</li>
<li><a href="#"><span class="menuBut">Mills & Misc</span></a>
<ul>
<li><a href="/pages/?subcat=samap_hand"><span class="triangle">▸</span> Hand Mills</a></li>
<li><a href="/pages/?subcat=samap_electric"><span class="triangle">▸</span> Electric Mills</a></li>
<li><a href="/pages/?subcat=samap_comm"><span class="triangle">▸</span> Commercial Mills</a></li>
<li><a href="/pages/?subcat=samap_comm"><span class="triangle">▸</span> Chestnut Mills</a></li>
<li><a href="/pages/?subcat=samap_dough"><span class="triangle">▸</span> Dough Mixer</a></li>
<li><a href="/pages/?subcat=samap_meter"><span class="triangle">▸</span> Grain Humidity Meter</a></li>
<li><a href="/pages/?subcat=porkert_wheatgrass"><span class="triangle">▸</span> Wheatgrass Juicer</a></li>
<li><a href="/pages/?subcat=porkert_ssg"><span class="triangle">▸</span> Small Seed Grinder</a></li>
<li><a href="/pages/?subcat=porkert_corn"><span class="triangle">▸</span> Corn Grinder</a></li>
<li><a href="/pages/?subcat=porkert_mincer"><span class="triangle">▸</span> Meat Mincer</a></li>
<li><a href="/pages/?subcat=porkert_nut"><span class="triangle">▸</span> Nut Grater</a></li>
<li><a href="/pages/?subcat=sauerkraut"><span class="triangle">▸</span> Sauerkraut Pots</a></li>
<li><a href="/pages/?subcat=max_labbe"><span>▸</span> Pottery Sprouter</a></li>
<li><a href="/pages/?cat=2&subcat=*order_mills"><span class="triangle">▸</span> Order Form</a></li>
</ul>
</li>
<li><a href="#"><span class="menuBut">Oils & Varnishes</span></a>
<ul>
<li><a href="/pages/?subcat=naturalP"><span class="triangle">▸</span> Natural Paints</a></li>
<li><a href="/pages/?subcat=naturalF"><span class="triangle">▸</span> Natural Finishes</a></li>
<li><a href="/pages/?subcat=floor"><span class="triangle">▸</span> Floor Products</a></li>
<li><a href="/pages/?subcat=osmo"><span class="triangle">▸</span> Osmo Products</a></li>
<li><a href="/pages/?cat=3&subcat=*order_oils"><span class="triangle">▸</span> Order Form</a></li>
</ul>
</li>
<li><a href="#"><span class="menuBut">Herbs & Chestnut Flour</span></a>
<ul>
<li><a href="/pages/?subcat=HE"><span class="triangle">▸</span> Herbs</a></li>
<li><a href="/pages/?subcat=CH"><span class="triangle">▸</span> Chestnut Flour</a></li>
<li><a href="/pages/?cat=4&subcat=*order_herbs"><span class="triangle">▸</span> Order Form</a></li>
</ul>
</li>
<li><a href="/pages/?subcat=contact"><span class="menuBut">Contact Us</span></a></li>
<li><a href="/pages/?subcat=shipping"><span class="menuBut">Shipping Info</span></a></li>
<li><a href="/pages/?subcat=links"><span class="menuBut">Links</span></a></li>
</ul>
</nav>
css file
/*
Document : mainStyle
Created on : Jul 22, 2012, 5:03:00 PM
Author : Arnold Acres Design
Description: Stylesheet for Golden Fields Limited.
*/
/* normal html tags */
body {
background-color: rgb(255,242,205);
background-image: url('/images/pattern.gif');
font-family: Verdana,Helvetica,Arial,sans-serif;
font-size:100%; /* making all */
font-size:16px; /* browsers font-size 1em - 16px */
font-size:1em; /* font-size - 1em = 16px */
}
#container { /*size of containing div */
max-width:858px;
margin:20px auto;
}
header {
width:100%;
height:85px;
margin-bottom:15px;
}
footer{
width:549px;
padding:0 20px;
float:right;
text-align:center;
font-size:0.75em; /* 12 / 16 */
line-height:1.2em;
margin-bottom:20px;
}
footer span {
color:#a68500;
}
footer a{
font-weight:normal;
}
section img {
padding:5px;
}
i {
font-style: italic;
}
b {
font-style:bold;
}
.menu {
width: 24.708624%; /*212px / 858px */
padding:0 5px;
float:left;
background-color:#f1e171;
border-left: 10px solid #e7b901;
text-align: center;
-moz-border-radius: 0 20px 20px 0;
-webkit-border-radius: 0 20px 20px 0;
border-radius: 0 20px 20px 0;
}
.menu li a {
display: block;
width:180px;
font-size: 0.75em; /* 12 / 16 */
margin: 11px 0 11px 12px;
padding-top:11px;
text-decoration: none;
color: #ea7617;
}
.menu li a:hover, .menu li a.active {
color: #000;
}
.menu li ul {
display: none; /* used to hide sub-menus */
}
.menu li ul li {
text-align:left;
}
.menu li ul li a {
padding: 3px 10px;
}
.menu li ul li a.active {
color:#000;
}
.menu span.triangle {
font-size:1.4em;
color:#a68500;
}
.menuBut {
display:block;
width:180px;
text-align:center;
padding:4px 3px;
-moz-border-radius: 8px 8px 8px 8px;
-webkit-border-radius: 8px 8px 8px 8px;
border-radius: 8px 8px 8px 8px;
z-index:500;
background: #c0c521; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #c0c521 69%, #edde6a 91%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(69%,#c0c521), color-stop(91%,#edde6a)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #c0c521 69%,#edde6a 91%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #c0c521 69%,#edde6a 91%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #c0c521 69%,#edde6a 91%); /* IE10+ */
background: radial-gradient(ellipse at center, #c0c521 69%,#edde6a 91%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c0c521', endColorstr='#edde6a',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
section {
width:549px;
padding:10px 20px 20px 20px;
float:right;
background-color: #f1e171;
border-right: 10px solid #c0c521;
text-align: justify;
-moz-border-radius: 20px 0 0 20px;
-webkit-border-radius: 20px 0 0 20px;
border-radius: 20px 0 0 20px;
}
section p {
font-size:0.875em; /* 14 / 16 */
line-height:1.2em;
padding-bottom:10px;
}
section ul {
list-style:disc;
padding:0 0 10px 5px;
}
section li {
font-size:0.875em; /* 14 / 16 */
line-height:1.2em;
padding-bottom:10px;
}
section li:last-child {
padding-bottom:0;
}
h1 {
font-weight:bold;
font-size:1.5em;
padding-top:5px;
padding-bottom:10px;
}
section h1:first-child {
padding-top:0;
}
a{
/* color: brown;*/
color:#ea7617;
font-weight: bold;
text-decoration: none;
}
.cellbgHome {
background-color:#fff2cd;
margin: 0;
font-size:0.875em;
line-height:1.3em;
padding:8px 4px;
width:50%;
vertical-align:top;
border-color: #f1e171;
border-width: 3px 3px 0 0;
border-style: solid;
}
#extraInfo {
background-color:#fff;
border:1px solid #000;
margin-top:20px;
padding:0 10px;
}
table .shipInfo {
font-size:0.85em; /* 12 / 16 */
line-height:1.2em;
}
table.contactus td {
padding:3px;
vertical-align:top;
font-size:0.85em; /* 12 / 16 */
line-height:1.2em;
}
table.prodTable {
border-collapse: collapse;
width:552px;
font-size:0.85em; /* 12 / 16 */
line-height:1.2em;
}
table.prodTable thead {
background-color:#c0c521;
color: white;
font-size:8pt;
font-weight: bold;
}
table, th, td
{
border-bottom: 2px solid #f1e171;
border-right: 2px solid #f1e171;
padding:4px;
vertical-align: middle;
}
.cellbg{
background-color: #fff2cd;
}
.rightAlign {
text-align: right;
}
.centreAlign {
text-align:center;
}
.leftAlign {
text-align:left;
}
.none {
display:none;
}
Home page index.php
<?php
$current_menu = "Home";
include $_SERVER['DOCUMENT_ROOT'] . "/../code4/db.inc.php";
?>
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0,width=device-width"/>
<title>Welcome | Golden Fields Limited</title>
<meta name="description" content="Golden Fields - New Zealand Organic Coffee Substitutes - Purchase Online.">
<meta name="keywords" content="golden fields,new zealand,golden fields dandelion,golden fields coffee,dandelion coffee">
<meta name="author" content="Arnold Acres Design">
<meta name="copyright" content="Golden Fields Limited">
<meta name="contact_addr" content="Philippe Weiss <sales@goldenfields.co.nz>">
<meta name="robot" content="ALL">
<meta name="revisit-after" content="30 Days">
<!-- **** layout stylesheets **** -->
<link rel="stylesheet" href="/css/reset.css">
<link rel="stylesheet" href="/css/mainStyle.css">
<!-- jQuery 1.7.1 -->
<script src="/js/jquery.min.js"></script>
<script src='js/jquery.cookie.js'></script>
<script src='js/jquery.hoverIntent.minified.js'></script>
<script src='js/jquery.dcjqaccordion.2.7.min.js'></script>
<!-- Modernizr 2.5.3 -->
<script src="/js/modernizr.js"></script>
<!--<script src="/js/menu.js"></script>-->
<script>
$(document).ready(function($){
$('.menu').dcAccordion({
eventType: 'click',
autoClose: true,
saveState: true,
disableLink: true,
speed: 'fast',
showCount: false,
autoExpand: true,
cookie : 'dcjq-accordion-1',
classExpand : 'dcjq-current-parent'
});
});
</script>
</head>
<body>
<div id="container">
<?php
include $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/nav.php";
?>
<section>
<p>
Welcome to <i>Golden Fields</i>. Established in 1987, and based in clean, green New Zealand, <i>Golden Fields</i> is a coffee substitute manufacturer and importer of natural paints and oils, mills and other products promoting a healthy lifestyle.
</p>
<p>
Below is a snapshot of our most popular products, please consult the menu on the left for a comprehensive listing.
</p>
<p>
Below is a snapshot of our most popular products, please consult the menu on the left for a comprehensive listing.
</p>
<table class="tableHome" cellspacing="2" width=550px>
<tr>
<td class="cellbgHome" width="50%">
<b>BioPin</b><br>
• <a href="natural_paints.php">Natural paints</a><br>
• <a href="floor_products.php">Natural oils, stains & varnishes</a><br>
</td>
<td class="cellbgHome" width="50%">
<b>Porkert</b><br>
• <a href="corn_grinder.php">Grinders</a><br>
• <a href="wheatgrass_juicer_fruit_press.php">Juicers</a><br>
• <a href="meat_mincer.php">Mincers</a><br>
</td>
</tr>
<tr>
<td class="cellbgHome">
<b>Samap</b><br>
• <a href="hand_mill.php">Hand stone grain mills</a><br>
• <a href="electric_mill.php">Electric stone grain mills</a><br>
• <a href="grain_humidity_meter.php">Grain humidity meter</a><br>
</td>
<td class="cellbgHome">
<b>Osmo</b><br>
• <a href="osmo.php">Natural wood finishes</a><br>
</td>
</tr>
<tr>
<td class="cellbgHome">
<b>Fermentation Pots</b><br>
• <a href="sauerkraut_pot.php">Sauerkraut pots</a><br>
• <a href="sauerkraut_pot.php">Cabbage shredders</a><br>
</td>
<td class="cellbgHome">
<b>Coffee & Teas</b><br>
• <a href="dandelion_coffee.php">Dandelion coffee</a><br>
• <a href="all_coffees.php">Other coffee alternatives</a><br>
• <a href="herbs.php">Herbal Teas</a><br>
</td>
</tr>
</table>
<div id="extraInfo">
<h1 style="font-size:24px;"><b>New Products</b></h1>
<p>
<img style="float: right" src="/images/sprouters/sprouterLargeAndSmall2.jpg" />
<img style="float: right" src="/images/sprouters/sprouterSmallTrays2.jpg" />
<b>Pottery Sprouters</b>
</p>
<p>
Sprouting is an easy way to add essential vitamins and enzymes to your diet. It takes very little space in the kitchen and allows you to grow some of your food without actually needing a garden.<br><a href="sprouter.php">Check them out here.</a>
</p>
<br>
<p>
<b>Peppermint tea</b>
</p>
<p>
With our own peppermint, organically grown in Canterbury.
</p>
</div>
</section>
<?php
$foot = '';
include $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php";
?>
</div>
</body>
</html>
All other pages index.php
<?php
include $_SERVER['DOCUMENT_ROOT'] . '/includes/helpers.inc.php';
?>
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0,width=device-width"/>
<title><?php echo $title; ?></title>
<meta name="description" content="<?php echo $meta_description; ?>">
<meta name="keywords" content="<?php echo $meta_keywords; ?>">
<meta name="author" content="Arnold Acres Design">
<meta name="copyright" content="Golden Fields Limited">
<meta name="contact_addr" content="Philippe Weiss <sales@goldenfields.co.nz>">
<meta name="robot" content="ALL">
<meta name="revisit-after" content="30 Days">
<!-- **** layout stylesheets **** -->
<link rel="stylesheet" href="/css/reset.css">
<link rel="stylesheet" href="/css/mainStyle.css">
<!-- jQuery 1.7.1 -->
<script src="/js/jquery.min.js"></script>
<script src='js/jquery.cookie.js'></script>
<script src='js/jquery.hoverIntent.minified.js'></script>
<script src='js/jquery.dcjqaccordion.2.7.min.js'></script>
<!-- Modernizr 2.5.3 -->
<script src="/js/modernizr.js"></script>
<!--<script src="/js/menu.js"></script>-->
<script>
$(document).ready(function($){
$('.menu').dcAccordion({
eventType: 'click',
autoClose: true,
saveState: true,
disableLink: true,
speed: 'fast',
showCount: false,
autoExpand: true,
cookie : 'dcjq-accordion-1',
classExpand : 'dcjq-current-parent'
});
});
</script>
</head>
<body>
<div id="container">
<?php
include $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
include $_SERVER['DOCUMENT_ROOT'] . "/includes/nav.php";
?>
<section>
<?php
echo $top;
echo $table_head;
if ($table_type == 1) :
?>
<tbody>
<?php foreach ($results as $row) : ?>
<tr>
<td class="cellbg"><?php htmlout($row['pID']); ?></td><td class="cellbg"><?php htmlout($row['description']); ?></td><td class="cellbg rightAlign">$<?php htmlout($row['price']); ?></td><td class="cellbg rightAlign"> </td>
</tr>
<?php endforeach; ?>
</tbody>
<?php elseif ($table_type == 2) : ?>
<tbody>
<?php foreach ($results as $row) : ?>
<tr>
<td class="cellbg"><?php htmlout($row['pID']); ?></td><td class="cellbg"><?php htmlout($row['description']); ?></td><td class="cellbg rightAlign">$<?php htmlout($row['price']); ?></td><td class="cellbg rightAlign"><?php htmlout($row['priceINTL']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php elseif ($table_type == 3) : ?>
<tbody>
<?php foreach ($results as $row) : ?>
<tr>
<td class="cellbg"><?php htmlout($row['pID']); ?></td><td class="cellbg"><?php htmlout($row['description']); ?></td><td class="cellbg">Info</td><td class="cellbg centreAlign"><?php htmlout($row['coverage']); ?></td><td class="cellbg rightAlign">$<?php htmlout($row['price']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php elseif ($table_type == 4) :
?>
<tbody>
<?php foreach ($results as $row) : ?>
<tr>
<td class="cellbg"><?php htmlout($row['pID']); ?></td><td class="cellbg"><?php htmlout($row['description']); ?></td><td class="cellbg rightAlign">$<?php htmlout($row['price']); ?></td><td class="cellbg rightAlign"> </td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
<?php
if ($table_type != '') {
echo '</table>';
}
?>
</section>
<?php
include $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php";
?>
</div>
</body>
</html>
Thanks for your help