Results 1 to 5 of 5

Thread: ddaccordian - need clickgo on hide/collapse

  1. #1
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ddaccordian - need clickgo on hide/collapse

    1) Script Title: ddacordian

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

    3) Describe problem:

    Is it possible to get the clickgo behaviour also when the H3>UL group is collapsed (it only seems to happen when expanding)? I see this around line 126
    Code:
    if (config.revealtype=="clickgo"){
    			config.postreveal="gotourl" //remember added action
    			config.revealtype="click" //overwrite revealtype to "click" keyword
    		}
    but my hamfisted attempts at javascript just make it break...

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

    Default

    Try the below modified .js file, which should do it.
    DD Admin

  3. #3
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    ddadmin - I am truly impressed with your speed of response. However, take a look at:

    http://www.kwiksite.santdemo.co.uk

    If you expand "Products" and then click on "Our Services" and back again, you will see it's picking up the wrong target.href somewhere in the code...

    Look, I truly appreciate your effort, and if you can work this out, I'm happy to paypal you a few quid!

    Cheers for any help

    Steve

    please PM me if you need to communicate directly.

  4. #4
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    WOOT!!!! I think I might have fixed it...

    Line 185

    Code:
    ddaccordion.collapseit(lastexpanded.$header, lastexpanded.$content, config, true, false) //next to Last Boolean value sets 'isuseractivated' parameter
    If I read it correct, then the above only happens to close previously expanded headers - so it stands to reason they haven't been "clicked" (as the user just clicked something else!)

    and then around line 90

    Code:
    if (targetLink && directclick) //if this header is a link
    That's it... it works now as I hoped.. just need to check it in the other browsers... Your comments would be most appreciated, as I am in no way totally confident in my code hacking!

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

    Default

    If it works it works Let me know if you find any problems in other browsers. The two browsers I tested the modified code in were IE8 and FF3.6 btw.
    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
  •