Results 1 to 5 of 5

Thread: Accordion Bullet Menu header links with submenus not working

  1. #1
    Join Date
    Apr 2005
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Accordion Bullet Menu header links with submenus not working

    1) Script Title: Bullet List Accordion Menu

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

    3) Describe problem:

    We have the menu working fine, except we want to be able to click on a menu header, a new page is to display and then the sub menus to also be able to show. This should be possible by using the persist state as detailled in this forum response, which is set correctly:

    http://www.dynamicdrive.com/forums/s...ad.php?t=41719


    HOWEVER - we seem to have a different problem, whereby if you rollover your mouse on the header link, the status bar shows that it is coded correctly to link to a dedicated url page, but when you click the header link, the submenu drops down correctly, but the page does not change.

    If we change the menu script settings to on mouseover rather than onclick, it woks fine and allows us to click on the menu headings and the link works, but we want it onclick.


    Many Thanks
    Last edited by carterj; 04-04-2009 at 07:56 PM.

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

    Default

    Try upgrading to the latest v1.7 of the script (only the .js file changed). Then, in your settings.js file, change the line in red to the below value:

    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: "clickgo", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
    	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: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    	animatespeed: "slow", //speed of animation: "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
    	}
    })
    What this does is cause the headers to still expand onClick, but after its sub contents have expanded, also take the user to the URL defined inside the header.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    carterj (04-04-2009)

  4. #3
    Join Date
    Apr 2005
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Thanks

    Thats fixed it !

    Much appreciated.

    Kind Regards

  5. #4
    Join Date
    Dec 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello

    I know this is an old thread but my question is relevant to this thread. My hyperlinks work 100% the only problem that I have is that it is not opening the link in the target frame I have.

    <div class="menuheader expandable"><div><span class="span"><a href="Home/home.aspx" target="iframe" id="home" runat="server">Home</a></span></div></div>

    and the frame

    <iframe id="iframe" name="iframe" src="Home/home.aspx" runat="server" frameborder="0" scrolling="no" width="780" height="659"></iframe>

    when it opens the link it opens it over the whole page.

    and I think it has something to do with the following:

    if (config.postreveal == "gotourl" && directclick) { //if revealtype is "Go to Header URL upon click", and this is a direct click on the header
    var targetLink = ($targetHeader.is("a")) ? $targetHeader.get(0) : $targetHeader.find('a:eq(0)').get(0)
    if (targetLink) //if this header is a link
    setTimeout(function () { location = targetLink.href }, 200 + (scrolltoheader ? 400 + sthdelay : 0)) //ignore link target, as window.open(targetLink, targetLink.target) doesn't work in FF if popup blocker enabled
    }

    adding window.open(targetLink, targetLink.target) works but then all the headers are open and do not close
    Last edited by mikie; 12-12-2014 at 09:49 AM.

  6. #5
    Join Date
    Dec 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Got it, just removed setTimeout(function () { location = targetLink.href }, 200 + (scrolltoheader ? 400 + sthdelay : 0)) and replaced it with window.open(targetLink, targetLink.target) and it worked

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
  •