Results 1 to 5 of 5

Thread: Glossy Accordion Menu Problem

  1. #1
    Join Date
    May 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Glossy Accordion Menu Problem

    hey iam a newbie to javascripting and thats the reason why i must make a question.
    Iam taking your script from http://www.dynamicdrive.com/dynamici...enu-glossy.htm

    and i think its very nice and working good in my enviroment.

    But there is one problem. I made a big menu and sometimes i have a submenu and sometimes i dont have a submenu. All is ok but only thing dont work as i would like. for example, you open the submenu of one thing and click on a side in the submenu, now its open. Now i would like back to the mainpage (there is no submenu at the mainpage), so the browser open the mainpage but the last submenu i had open will not be closed. How can i make it that the menu is closed when iam at a point, where no submenu available.
    Hope you understand me ...
    thx regards

  2. #2
    Join Date
    Aug 2004
    Posts
    9,918
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Sounds like you might have persistence of the last opened sub menu turned on. Try turning off inside your initialization code:


    Code:
    <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", "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
    		//do nothing
    	},
    	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    		//do nothing
    	}
    })
    
    
    </script>
    DD Admin

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

    Default

    big thx - it works.
    i made the changes in the code on the sides which have no submenu.

    But one little thing is there. Hope i can explain it

    If i click in the menu structure on a side with submenu, the submenu open and i click on the page i want. now the sumbmenu is open at the point where i click and thats what i want ...... now i click back to another page without submenu and the page open and the submenu is closed .... how i it wanted.
    But now i click on a submenu, it open and i click a site in the submenu .... the page open BUT he open not the correct submenu where i clicked, he just opened another submenu where i dont click ....... After this and clicking somewhere in menu it all worked good and correct. Except clicking in this way ..... ?????
    Sometimes it worked and sometimes there this little problem. i dont understand it, because i dont know the real way to reproduce the error.


    thx regards

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    2,038
    Thanks
    16
    Thanked 316 Times in 314 Posts
    Blog Entries
    13

    Default

    We need a link to your page - you might have something wrong with your HTML but we dont know that and we can't offer suggestions until we see it.
    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

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

    Default

    there is a testversion of the page i make

    http://www.pixelstripes.de/hoefer/index.html

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
  •