Results 1 to 3 of 3

Thread: Add Expand list menu on "ddaccordionmenu"

  1. #1
    Join Date
    Sep 2013
    Location
    Indonesia
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Add Expand list menu on "ddaccordionmenu"

    1) Script Title: Urban Gray Accordion Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...menu-urban.htm

    3) Describe problem:
    When I drag mouse to sub menu, i want to build different menu expands.

    So this is the problem

    -->Header
    ---->Sub menu
    ---->Sub menu
    ---->Sub menu
    -->Header
    ---->Sub menu
    ---->Sub menu
    ---->Sub menu

    i want to build this
    --> Header
    ---->Sub menu
    ------>Sub menu 2
    ------>Sub menu 2
    ---->Sub menu
    ---->Sub menu
    --> Header
    ---->Sub menu
    ---->Sub menu
    ------>Sub menu 2
    ------>Sub menu 2
    ---->Sub menu
    ---->Sub menu

    How to build that "Sub menu 2" ?

    can anyone help?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,998
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    12

    Default

    It doesn't look like that menu supported multi-levels/nested menus. I'm not sure if an update is planned but there are many similar scripts available online that you could try instead: http://www.1stwebdesigner.com/freebi...nus-tutorials/ (some support further nested menus, others don't)
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    I wouldn't give up on the DD Accordion just yet. It looks like if you setup a second menu with:

    Code:
    	collapseprev: false, //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)
    Like:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.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: "headerbar", //Shared CSS class name of headers group
    	contentclass: "submenu", //Shared CSS class name of contents group
    	revealtype: "mouseover", //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: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    	onemustopen: true, //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: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "normal", //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
    		//do nothing
    	}
    })
    
    ddaccordion.init({
    	headerclass: "headerbar2", //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", "clickgo", or "mouseover"
    	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    	collapseprev: false, //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: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "normal", //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
    		//do nothing
    	}
    })
    
    </script>
    
    <style type="text/css">
    
    .urbangreymenu{
    width: 190px; /*width of menu*/
    }
    
    .urbangreymenu .headerbar, .urbangreymenu .headerbar2{
    font: bold 13px Verdana;
    color: white;
    background: #606060 url(arrowstop.gif) no-repeat 8px 6px; /*last 2 values are the x and y coordinates of bullet image*/
    margin-bottom: 0; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 7px 0 7px 31px; /*31px is left indentation of header text*/
    }
    
    .urbangreymenu .headerbar a{
    text-decoration: none;
    color: white;
    display: block;
    }
    
    .urbangreymenu ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 0; /*bottom spacing between each UL and rest of content*/
    }
    
    .urbangreymenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .urbangreymenu ul li a{
    font: normal 12px Arial;
    color: black;
    background: #E9E9E9;
    display: block;
    padding: 5px 0;
    line-height: 17px;
    padding-left: 8px; /*link text is indented 8px*/
    text-decoration: none;
    }
    
    .urbangreymenu ul li a:visited{
    color: black;
    }
    
    .urbangreymenu ul li a:hover{ /*hover state CSS*/
    color: white;
    background: black;
    }
    
    </style>
    
    <body>
    
    <div class="urbangreymenu">
    
    <h3 class="headerbar"><a href="http://www.dynamicdrive.com/style/">CSS Library</a></h3>
    <ul class="submenu">
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C1/">Horizontal CSS Menus</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C2/">Vertical CSS Menus</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C4/">Image CSS</a></li>
    <li>
    <h3 class="headerbar2"><a href="http://www.dynamicdrive.com/style/">CSS Library</a></h3>
    <ul class="submenu2">
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C1/">Horizontal CSS Menus</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C2/">Vertical CSS Menus</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C4/">Image CSS</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C6/">Form CSS</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C5/">DIVs and containers</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C7/">Links & Buttons</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C8/">Other</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/all/">Browse All</a></li>
    </ul>
    </li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C5/">DIVs and containers</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C7/">Links & Buttons</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/category/C8/">Other</a></li>
    <li><a href="http://www.dynamicdrive.com/style/csslibrary/all/">Browse All</a></li>
    </ul>
    
    <h3 class="headerbar"><a href="http://www.javascriptkit.com">JavaScript Kit</a></h3>
    <ul class="submenu">
    <li><a href="http://www.javascriptkit.com/cutpastejava.shtml" >Free JavaScripts</a></li>
    <li><a href="http://www.javascriptkit.com/javatutors/">JavaScript tutorials</a></li>
    <li><a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a></li>
    <li><a href="http://www.javascriptkit.com/dhtmltutors/">DHTML & CSS</a></li>
    <li><a href="http://www.javascriptkit.com/howto/">Web Design</a></li>
    <li><a href="http://www.javascriptkit.com/java/">Free Java Applets</a></li>		
    </ul>
    
    </div>
    
    </body>
    
    </html>
    It works and, with a little tweaking of the css, it could look good too.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Replies: 0
    Last Post: 05-19-2013, 11:22 PM
  2. "expand" button of expandableticker script not working on master page.
    By dmelnyk in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 02-26-2013, 01:41 PM
  3. Collapse Submenu in "Bullet List Accordion Menu with nested levels"
    By FeKuLa in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 09-08-2008, 10:44 AM
  4. Replies: 0
    Last Post: 06-10-2008, 07:27 PM
  5. need an option to "expand all" in folding tree menu
    By ender in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-09-2006, 03:25 PM

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
  •