Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24173

    Hi guys,

    i use the accordion shortcode to get 5 toggles displayed on one of my pages. Is it possible to hide toggle 2 – 5 if toggle 1 is opened ?

    In other words if someone opens one of the 5 toggles i have i would like to hide the rest of the toggles.

    Does that make sense ?

    Is that may possible ?

    LG

    Sascha

    #122630

    Hi,

    Sort of like a prize drawing whereby as soon as one door is opened , the other doors get disabled? or in this case the toggles that were never opened disappear? It could be done since each individual toggle has its own unique ID, and there is already code that tracks the opening and closing of toggles. Just need to add some jQuery to it that adds a display:none; style to the appropriate div tags. I am not sure something like this is in the scope of the support team’s purpose especially in the light of the time it will take to figure this out and test it. Though I am not sure., see what the others think.

    Thanks,

    Nick

    #122631

    Exactly … i have five toggles and i would like to get it working the way that if a customer opens toggle 1 that the rest of the toggles (2-4) get disabled ( a display:none ) if the customer close toggle 1 all toggles get back visible again. If the open toggle 2 than toggle 1,3,4,5 are getting a display none.

    Im not that familiar with jquery so i thought to ask you guys ;) i know the the code i need to modify is located in the shortcode.js

    I hope you have the time to point me into the right direction. Im sure other people will also benefit from the solution.

    Many many thanks

    Shorty

    #122632

    Hi,

    in shortcodes.js find line 308-327

    replace it with

    thisheading.on('click', function()
    {
    if(content.is(':visible')) //if open and gets click
    {
    allContent.siblings().show();
    heading.show();
    allContent.slideUp(200);
    thisheading.removeClass('activeTitle');
    }
    else //if closed and gets click
    {
    if(container.is('.toggle_close_all'))
    {
    allContent.slideUp(200);
    heading.removeClass('activeTitle');
    }

    allContent.siblings().hide();
    thisheading.show();
    content.slideDown(200);
    thisheading.addClass('activeTitle');
    }
    });

    These are the settings it works with http://www.clipular.com/c?7176314=OpNDsZKo2367by8JWoob5VVDBpc&f=.png

    Thanks,

    Nick

    #122633

    Perfect ! That works like a charm ;)

    You guys rock!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Hide toggles if a toggle is open.’ is closed to new replies.