Results 1 to 7 of 7

Thread: Can Glossy Accordion Menu function across frames?

  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can Glossy Accordion Menu function across frames?

    1) Script Title: Glossy Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...enu-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?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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>
    DD Admin

  3. #3
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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!

  4. #4
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #5
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Quote Originally Posted by Alassea View Post
    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?

  6. #6
    Join Date
    Mar 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Quote Originally Posted by Alassea View Post
    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.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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):

    Code:
    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.
    DD Admin

Bookmarks

Posting Permissions

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