PDA

View Full Version : Can Glossy Accordion Menu function across frames?



Alassea
03-30-2011, 10:47 AM
1) Script Title: Glossy Accordion Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm

3) Describe problem:
I would like to put the menu in a frame on the left, and pages linked to from a header or from a submenu list to open in another frame.
The example does so in an Iframe, can it be done in a html frame?

ddadmin
03-30-2011, 08:35 PM
The process with IFRAME and regular FRAMES is exactly the same actually. This is with regards to the header links. For the submenu links, you would just add a target attribute to get those links to also open in the FRAME, for example:


<div class="submenu">
<ul>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C1/" target="myframe">Horizontal CSS Menus</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C2/" target="myframe">Vertical CSS Menus</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C4/" target="myframe">Image CSS</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C6/" target="myframe">Form CSS</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C5/" target="myframe">DIVs and containers</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C7/" target="myframe">Links & Buttons</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C8/" target="myframe">Other</a></li>
<li><a href="http://www.dynamicdrive.com/style/csslibrary/all/" target="myframe">Browse All</a></li>
</ul>
</div>

Alassea
03-30-2011, 10:36 PM
I must admit, I'm no script programmer, so I'll probably stumble around until I happen to get it right, haha.
But I think you've pointed me into the right direction, I will try tomorrow after some coffee.
If I can't get it to work, I'll come asking again, if you don't mind.

For now, thank you, and good night!

Alassea
04-05-2011, 07:38 AM
I'm sorry, I'm not getting it right.
The frame I want the header links to open in is named "hoofdtekst", where do I change things to make it so? And how do I tell the menu not to fabricate an iframe under the menu itself?
I copied the code that uses the iframe, but somehow I'm missing where it does that.

Alassea
04-10-2011, 03:21 PM
I'm sorry, I'm not getting it right.
The frame I want the header links to open in is named "hoofdtekst", where do I change things to make it so? And how do I tell the menu not to fabricate an iframe under the menu itself?
I copied the code that uses the iframe, but somehow I'm missing where it does that.


Anyone, please?

Alassea
04-25-2011, 10:52 AM
Anyone, please?

I'm sorry, maybe it's not allowed to ask multiple questions about the same subject.
If so, please tell me, but don't leave me hanging here without any response.

ddadmin
04-25-2011, 11:37 PM
Sorry for the delay. Assuming the target frame you wish to load the menu headers' link inside is called "hoofdtekst", you'll want to edit the onopenclose() event handler of the initialization code as follows (in red):


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", "clickgo", 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: true, //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: ["suffix", "<img src='plus.gif' class='statusicon' />", "<img src='minus.gif' class='statusicon' />"], //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
myiframe=parent.frames["hoofdtekst"]
if (expandedindices.length>0) //if there are 1 or more expanded headers
myiframe.location.replace(headers[expandedindices.pop()].getAttribute('href')) //Get "href" attribute of final expanded header to load into IFRAME
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
if (state=="block" && isuseractivated==true){ //if header is expanded and as the result of the user initiated action
myiframe.location.replace(header.getAttribute('href'))
}
}
})

That should do it. If you still need help, let me know.