Home / Forums / DynamiX Support / Accordian – want them all to be collapse and I’m not sure if any of the existing help tells me how.

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts

  • Jennifer Lee
    Participant

    Good Day – I wondering if someone could tell me how to make an accodian (short code) remain closed until end user clicks on a title. Also can you tell me if this is a setting that will effect all accodians throughout my site or if it can be set per embedding.. I prefer to make the change per short code..

    Andy
    Andy
    Keymaster

    Hi Jen,

    What version of DynamiX are you using? 

    If you're using 2.8.1+

    add the following to the bottom of your DynamiX/lib/js/dynamix.min.js file. 


    (function ($) {$(document).ready(function() {

    var getacc_id = parseInt(window.location.hash.slice(1)); // retrieve # number

    if(!getacc_id) {getacc_id = false;}

    $(".accordion").accordion({ header: "h3.accordionhead",autoHeight: false,collapsible: true,navigation:true,active:getacc_id});

    });})(jQuery);

    Peter Smythe
    Participant

    Andy,

    Which template file is that? (create.php, blogs-loop.php, etc.)


    Jennifer Lee
    Participant

    Thank you.

    Will this code give me the ability to close all, open all and open specific for each page?

    By the way have I told you how happy I am with this theme, your support and this communitee – I don't think I'll purchase a theme elsewhere ever!

    Andy
    Andy
    Keymaster

    Peter, my theme doesn't include those files… as mentioned it should be in DynamiX/lib/js/dynamix.min.js.

    Jennifer, yes that will allow you close all and open a specific tab using #0, #1 etc added to the end of the URL. e.g. domain.com/#2 would open the 3rd panel. 

    I'm glad you're happy with it, I've got more themes on the way so hopefully you'll enjoy them as much if not more 😉


    Peter Smythe
    Participant

    Adam,

    I put the code in but it isn't working. May I suggest adding a toggle button on the shortcode in the next upgrade? I have a couple of long accordians that go off the page.

    Andy
    Andy
    Keymaster

    Hi Peter,

    What's the URL to your site? 


    Peter Smythe
    Participant

    Adam,

    appeals.me is the url. The particular page is http://appeals.me/appeals-2/.

    I probably didn't install the code the right way (but being the neophyte that I am, I didn't see exactly how I was to do it). When I pasted the code at the bottom of the .js file, it turned the shadow/reflection of the photos off. I reinstalled the original file.

    Andy
    Andy
    Keymaster

    Not sure who Adam is..? 😉

    I've checked your file and it's not added there. http://appeals.me/wp-content/themes/DynamiX/lib/js/dynamix.min.js


    David Winn
    Participant

    Andy

    I too would like to do this but I am also not sure where to add the code at the end of the file. 

    This is the last bit of compressed code I see:

    |paddingLeft|paddingBottom|beginPath|5000'.split('|'),0,{}))

    Where exactly do I put the new code? I placed it after the last ) but that didn't seem to accomplish anything. 

    Thanks

    Dave

    Andy
    Andy
    Keymaster

    Hi Dave, that's correct it should be placed directly after the code. 

    Can you send a link to your site please?


    Chris
    Participant

    Hello, quick question regarding this. 

    I've updated the file with the code. How do I set the accordion to default to the closed position.

    I have a page with 10 accordions, want them all closed until user clicks one.

    Thanks in advance.

    Andy
    Andy
    Keymaster

    Hi,

    Please see code above to close accordion panels – however it's not possible to close other accordions with one panel. 


    Alistair Cowan
    Participant

    I tried following these instructions – made me feel like a complete dummy.  I think it's more of an advanced code edit – or I'm missing something very simple.  

    I'd second Peter Smythe's request for a shortcode toggle button…

    Alistair.

    Andy
    Andy
    Keymaster

    Alistair,

    What version of DynamiX are you using?

Viewing 15 posts - 1 through 15 (of 33 total)

You must be logged in to reply to this topic.