Ticket: #54892 Status: CLOSED Average Speed: 1.3 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

    4:16 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');
    });

     

    4:16 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!

    4:16 on May 17, 2013

  • I Am Nectar

    You're very welcome Daniel!

    4:16 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

    4:16 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

    4:16 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 :)

    4:16 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?

    4:16 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?

    4:16 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!

    4:16 on August 15, 2014

Updating...