accphotography
02-25-2009, 01:34 PM
1) Script Title: Glossy Accordion Menu
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm
3) Describe problem: I'm trying to make this menu multi-leveled (it's two automatically, I'm trying to get three) but it's not working out. I've read every thread I can find on the subject and I've spent alot of time looking at the code of my pages and of the "bullet" code but I can't seem to locate the problem. There *are* some difference between my code and the "bullet" code but the CSS code is so different from the "glossy" code and I need some features of the glossy. I'm sure this is probably a simple solution, but I'm obviously just totally overlooking it.
Help? :o
html code:
<head>
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="ddaccordion.js">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view? persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
if (state=="block" && isuseractivated==false){ //if header is expanded and NOT as the result of the user's action (click or mouseover)
header.style.fontWeight=700
header.style.borderBottom="1px solid #cfcfcf"
}
}
})
ddaccordion.init({
headerclass: "submenuheader2", //Shared CSS class name of headers group
contentclass: "submenu2", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
if (state=="block" && isuseractivated==false){ //if header is expanded and NOT as the result of the user's action (click or mouseover)
header.style.borderBottom="1px solid #cfcfcf"
}
}
})
</script>
<script type="text/javascript">
(function($){
$(function(){
$('.submenuheader').click(function(){
var l = this.href;
setTimeout(function(){window.location.href = l;}, 300);
});
});
})(jQuery);
</script>
<script type="text/javascript">
(function($){
$(function(){
$('.submenuheader2').click(function(){
var l = this.href;
setTimeout(function(){window.location.href = l;}, 300);
});
});
})(jQuery);
</script>
</head>
<body>
<div id="leftcolumn">
<div id="mainmenu">Main Menu</div>
<div class="glossymenu">
<a class="menuitem" href="1.php">One</a>
<a class="menuitemheader submenuheader" href="2.php?submenuheader=0">Two</a>
<div class="submenu">
<ul>
<li><a href="3.php?submenuheader=0">Three</a></li>
</ul>
</div>
<a class="menuitembelow" href="4.php">Four</a>
<a class="menuitem" href="5.php">Five</a>
<a class="menuitemheader submenuheader" href="6.php?submenuheader=1">Six</a>
<div class="submenu">
<ul>
<li><a class="menuitemheader2 submenuheader2" href="7.php?submenuheader=1&submenuheader2=0">Seven</a>
<div class="submenu2">
<ul>
<li><a href="3.php?submenuheader=1&submenuheader2=0">Three</a></li>
</ul>
</div>
</li>
</ul>
</div>
<a class="menuitembelow" href="8.php">Eight</a>
</div>
I tried to paste my CSS code too but the message was too long. You can view it from the site: http://www.accphotography.com/GE/phptrial/ddmenu1/index.php
Also, is there any way to get the code to highlight or bold the page you are actively on even if it's not a header?
Thanks a million,
ACC
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm
3) Describe problem: I'm trying to make this menu multi-leveled (it's two automatically, I'm trying to get three) but it's not working out. I've read every thread I can find on the subject and I've spent alot of time looking at the code of my pages and of the "bullet" code but I can't seem to locate the problem. There *are* some difference between my code and the "bullet" code but the CSS code is so different from the "glossy" code and I need some features of the glossy. I'm sure this is probably a simple solution, but I'm obviously just totally overlooking it.
Help? :o
html code:
<head>
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="ddaccordion.js">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view? persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
if (state=="block" && isuseractivated==false){ //if header is expanded and NOT as the result of the user's action (click or mouseover)
header.style.fontWeight=700
header.style.borderBottom="1px solid #cfcfcf"
}
}
})
ddaccordion.init({
headerclass: "submenuheader2", //Shared CSS class name of headers group
contentclass: "submenu2", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
if (state=="block" && isuseractivated==false){ //if header is expanded and NOT as the result of the user's action (click or mouseover)
header.style.borderBottom="1px solid #cfcfcf"
}
}
})
</script>
<script type="text/javascript">
(function($){
$(function(){
$('.submenuheader').click(function(){
var l = this.href;
setTimeout(function(){window.location.href = l;}, 300);
});
});
})(jQuery);
</script>
<script type="text/javascript">
(function($){
$(function(){
$('.submenuheader2').click(function(){
var l = this.href;
setTimeout(function(){window.location.href = l;}, 300);
});
});
})(jQuery);
</script>
</head>
<body>
<div id="leftcolumn">
<div id="mainmenu">Main Menu</div>
<div class="glossymenu">
<a class="menuitem" href="1.php">One</a>
<a class="menuitemheader submenuheader" href="2.php?submenuheader=0">Two</a>
<div class="submenu">
<ul>
<li><a href="3.php?submenuheader=0">Three</a></li>
</ul>
</div>
<a class="menuitembelow" href="4.php">Four</a>
<a class="menuitem" href="5.php">Five</a>
<a class="menuitemheader submenuheader" href="6.php?submenuheader=1">Six</a>
<div class="submenu">
<ul>
<li><a class="menuitemheader2 submenuheader2" href="7.php?submenuheader=1&submenuheader2=0">Seven</a>
<div class="submenu2">
<ul>
<li><a href="3.php?submenuheader=1&submenuheader2=0">Three</a></li>
</ul>
</div>
</li>
</ul>
</div>
<a class="menuitembelow" href="8.php">Eight</a>
</div>
I tried to paste my CSS code too but the message was too long. You can view it from the site: http://www.accphotography.com/GE/phptrial/ddmenu1/index.php
Also, is there any way to get the code to highlight or bold the page you are actively on even if it's not a header?
Thanks a million,
ACC