Ticket: #54892 Status: OPEN Average Speed: 14.8 Days
public

Note: All average response time from this ticket will also be acquired by this person.

Cancel

“Possible to open toggle panels on page load?”

  • Daniel Cunningham

    Hi ThemeNectar, Loving the template so far, been a blast to work in! I was just curious if there was any possible way to keep the toggle panels open all of the time?

    So for example, say you have a page that has 4 toggle panels on it. When the user loads the page, the toggle panels are closed by default, and can be opened with a click.

    I'm wondering if it's possible to have them all already be opened when the page is loaded. Thanks, and again, great theme! Dan

    *edit* - formatting

    11:32 on May 17, 2013

  • I Am Nectar

    Hey Daniel!

    Open the init.js file located in the js folder and paste this anywhere after the first line:

    $(window).load(function(){
    	$('.toggle h3 a').trigger('click');
    });

     

    11:32 on May 17, 2013

  • Daniel Cunningham

    You are a scholar and a gentleman! I shall sing your praises from the mountain-tops! :)

     

    Thanks again! You're my hero!

    11:32 on May 17, 2013

  • I Am Nectar

    You're very welcome Daniel!

    11:32 on May 17, 2013

  • Shaun Burkowski

    What if you only want one of the toggles to be set to "open" and the others to remain "closed"?

    Also, is there a way to set the color of the closed toggles to something more colorful if you prefer not to use the gray? The open state used the accent color set in the theme as far as I can tell... but the default closed color is hard to see. I'd like to make it colorful and stand out if that's possible without editing the core files that might get overwritten when the theme is updated?

    Thanks,
    Shaun

    11:32 on April 17, 2014

  • Shaun Burkowski

    Please disregard my question about the toggle bar colors I found the answer elsewhere in the forums and should have looked further before asking here.

    /* CSS for background color on toggle bar */
    div.toggle h3 a {
        background-color: #fff;
    }
    
    /* CSS for headline text color on toggle bar */
    div.toggle h3 a {
       color: #fff;
    }
    
    /* CSS for + symbol on toggle bar */
    div.toggle h3 a i {
        color: #fff;
    }    
    div.toggle.open h3 a i {
        color: #000;
    }

    However, please let me know if it's possible to set the toggle to an "open" state for one toggle but not all?

    Thanks,
    Shaun

    11:32 on April 17, 2014

  • I Am Nectar

    Hey Shaun, sorry I got back with you about this on the comments first - but to reiterate, this wouldn't be possible without custom development but I've noted it for the wishlist.

    Cheers :)

    11:32 on April 21, 2014

  • Eugene Soo

    Hello! I've tried implementing the code $(window).load(function(){ $('.toggle h3 a').trigger('click'); }); in the init.js file but it doesn't seem to auto expand all toggles on page load. I'm on the latest version of salient, what could be wrong?

    11:32 on August 4, 2014

  • I Am Nectar

    Hey Eugene! Can you share your page URL where the toggles are so I can see why this isn't working?

    11:32 on August 5, 2014

  • Uri Lichtenfeld

    Sending you MUCH love and GOOD Karma... this little ticket/trick/js has just SIGNIFICANTLY improved what I was working on.

    Thanks!

    11:32 on August 15, 2014

  • Matt Worthington

    I'm having the same problem as Eugene. In fact, for a brief moment, it worked (like 2 hours) and then it stopped loading pages across my entire site. Once I took that line of JS out, the website started functioning properly again.

    4 days ago on November 17, 2014 at 4:42pm

  • I Am Nectar

    Hey! Make sure you're adding that line after this in the file:

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

    2 days ago on November 19, 2014 at 2:10pm

  • Matt Worthington

    Is there any way to do this on a page-by-page basis?

    2 days ago on November 19, 2014 at 2:25pm

  • Shaun Burkowski

    How can I set each toggle to react independently of one another? Meaning... I have a page with one toggle set to open and the rest set to close. I want to be able to click the toggle bar to open and close each without effecting the others on the same page. Please see example at http://syrenusa.com/syren-tempio-sporting/

    Go to the second toggle and try to open it. The second toggle opens, but the first toggle closes shifting the page content up and forcing you to adjust the page to see the new toggle's content. Very frustrating.

    I simply want each toggle to react independently of the others on the same page. Open and close each by clicking on the toggle bar, not this only one allowed to be open at a time madness.

    I do however still need the first toggle to be set to open when the page loads.

    Any advice?

    2 days ago on November 19, 2014 at 2:43pm

  • Tahir - SUPPORT

    Hey Shaun!

    I am afraid we dont have any advice . Please consider using other page elements if the toggles are not working as per your liking. The toggles in Salient follow standard design practices . 

    Best,

    -T

    2 days ago on November 20, 2014 at 5:46am

  • Shaun Burkowski

    Tahir, I can't imagine I'm the only one having this issue? I mean what's more standard than click open, click close? It seams like the click to open = close another would be counterintuitive to standard design practices.

    In any regard, great theme! Just this one bug is driving me crazy.

    2 days ago on November 20, 2014 at 9:10am

  • I Am Nectar

    Hey Shaun,

    If you switch into the visual composer editor tab and turn the "Allow Collaspable All" option off for your toggle element this will change to that funcitonality :)

    8 hours ago

  • Shaun Burkowski

    Tahir, right... but if I do that, all of the toggles go to the closed state until they are clicked. How can I set the first toggle to be open on page load?

    The only way I could see to do that was to use the shotcode method in text block that looks something like the attached screen shot. Possible to simply add the open and closed when clicked functionality to my shortcode so I can keep the first tab set to open?

    8 hours ago

Updating...