Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1284588
    crydberg
    Participant

    Hi

    Im trying to enable a show/hide function at our page http://indentive.se/startsida-2/ .

    I have given the button an ID: clickme
    I have given the section an ID: showme
    and I have used Display:none for the section.

    This is what I use in JS
    $( “#clickme” ).click(function() {
    $( “#showme” ).toggle( “slow”, function() {
    // Animation complete.
    });
    });

    Nothing happens. How does this work? / Why is it not working?

    #1284696
    Rupok
    Member

    Hi there,

    Thanks for writing in! Your code doesn’t look right to do anything. Would you point us the buttons and the section? And clarify what you are trying to achieve. We’ll try to provide you some code for that.

    Cheers!

    #1285843
    crydberg
    Participant

    Hi!

    Okey, I saw another user sending it in so thought it would work (my bad!).

    I will try to explain.

    In the section called “Info Gasell” we have a button that says and the justifications reads…
    Under that section we have a section called “Show this”. (this section is display:none from the beginning since we don’t want it to show at first)

    What we want to happen:
    When you push the button in the section “info gasell” we want the text in the section “show this” to pop out.
    Like a read more-function. If you push the button again we want the text to fold in/be hidden.

    Any suggestion?

    Thanks for your help.

    #1285871
    Paul R
    Moderator

    Hi,

    You can try this third party plugin.

    https://wordpress.org/plugins/toggles-shortcode-and-widget/screenshots/

    Hope that helps.

    #1286006
    crydberg
    Participant

    Hi,

    Sorry I don’t understand how I am supposed to implement this in Cornerstone?

    we are not using the “edit page”-function under pages since we are using cornerstone.

    #1286086
    Joao
    Moderator

    Hi There,

    You will be able to place the shortcode in Corstone Raw Code Element instead.

    Let us know how it goes,

    Joao

    #1289614
    crydberg
    Participant

    Hi again,

    It is starting to work now.
    However, I have one final problem.
    The initial state for the toggle box is “open”. We want it to start as closed.
    Can you help me with this?

    #1289626
    Paul R
    Moderator

    You can add opened=”closed” to your shortcode to make it close by default.

    eg.

    
    [otw_shortcode_content_toggle title="My Title" opened="closed"]Your Content[/otw_shortcode_content_toggle]
    

    Hope that helps.

    #1289669
    crydberg
    Participant

    Thank you,
    it works now!

    #1289672
    Christopher
    Moderator

    You’re welcome.

  • <script> jQuery(function($){ $("#no-reply-1284588 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>