Results 1 to 7 of 7

Thread: Bullet List Accordion Menu with nested levels

  1. #1
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Bullet List Accordion Menu with nested levels

    1) Script Title: Bullet List Accordion Menu with nested levels

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

    3) Describe problem:

    If I click on the element : "<a href="http://www.cssdrive.com/index.php/menudesigns/" class="subexpandable">Menu Gallery</a>" it does open or close the element : "<ul class="subcategoryitems" style="margin-left: 15px">" but why it doesn`t load the page : "http://www.cssdrive.com/index.php/menudesigns/" ?

    I really would like tu use this Menu in one of my Pages, but I need to solve this problem first, so it works the way i want it. Idon`t have any idea, why if clicking the link "Menu Gallery", it doesn`t load the page, with wich it`s linked with. If I right-click the same link, and choose "open in new Window" it works.

    I hope somebody can help me with this.

    Thank you,

    Psyclown


    (i`m from Germany, so if my english isn`t the best, im Sorry...)

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

    Default

    That's because for headers that are set to toggle "onClick" (versus "onMouseover"), any link associated with the header becomes disabled. This is to allow the sub menu to actually expand/contract when the header is clicked on, instead of just going straight to the target page.

    What you can do is either set the toggle type to "mouseover" instead in the configuration code:

    Code:
    ddaccordion.init({
    	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
    	contentclass: "categoryitems", //Shared CSS class name of contents group
    	revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
    "
    "
    Or if you must enable the headers to both toggle "onclick" and navigate to a URL, try commenting out the below line inside the .js file:

    Code:
    		$('.'+config["headerclass"]).bind(config.revealtype, function(){
    			if (config.revealtype=="mouseenter"){
    				clearTimeout(config.revealdelay)
    				var headerindex=parseInt($(this).attr("headerindex"))
    				config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
    			}
    			else{
    				$(this).trigger("evt_accordion")
    				return false //cancel default click behavior
    			}
    		})
    DD Admin

  3. #3
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It works! The second example you wrote was exactly what I meant.

    So there`s nothing left to me, except to say thank you again.

    Thank you, for the fast answer and help, cause I couldn`t fix it by myself (I don`t know anything about JS, except the fact that it exists...)

    Psyclown

  4. #4
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    Iīve modified the .js like youīve explained.
    Now it does mostly what it should.
    But thereīs still one little bug...
    If I set an a tag into the h3 tag it works quit strange.
    Seems like the underlying h3 tags donīt act like they should do, if i expand another overlying h3 tag sometimes they collapse and sometimes they donīt.
    With out the a tag in the h3 tag it works well!

    Please take a look at my test-space...

    http://slimp.liquistyle.de/test

    Thanks for your help and the nice jQuery Plugin!


    greetings

    Psyclown

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

    Default

    I'm not sure I understand. What do you mean by:
    If I set an a tag into the h3 tag it works quit strange.
    Weren't you already using a A tag within the H3 to get it to act as a link, and that worked fine for you?
    DD Admin

  6. #6
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It still works, but: the H3 elements, which are not part of the submenu,
    sometimes open or close again, when they are supposed to do not.

    For example the "Terminkategorie" - Link, in my menu, sometimes I click it in order to close it, it opens again right after closing...

  7. #7
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, it`s me again...

    i think the problem is, that every click works as two clicks... one at the H3 in the parent region and one at the a-tag in the same H3 and so, it open and close right after that...

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
  •