Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #432734

    Hello,

    Is it possible to hide a fullwidth color section, and show it with a button or link ?

    Many thanks,

    Jean

    #432769

    Hi Jean

    Please edit your Color Section element and give it a unique ID – http://kriesi.at/documentation/enfold/wp-content/uploads/sites/2/2013/12/color-section-ID.png
    Then turn on custom CSS field for ALB elements and give your button element a custom class – http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/
    then add following code to Functions.php file in Appearance > Editor

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( "#your-unique-color-section-id" ).toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    Cheers!
    Yigit

    #432810

    Dear Yigit,

    Excellent !
    It works, but reverse : section is displayed and the button hides.
    I need the opposite: section is hidden by default and pressing the button showing.
    What needs to change?

    Best!

    jean

    #432812

    Hi!

    Can you please try changing the code to following one

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery("#your-unique-color-section-id").hide();
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( "#your-unique-color-section-id" ).toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    Best regards,
    Yigit

    #432832

    Hey,

    Yes, it works!
    Excellent support.
    Thanks to you and all the team

    Best regards,
    Jean

    #432838

    Hey!

    You are welcome Jean, glad we could help :) Let us know if you have any other questions!
    Happy Earth day!

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Hidding color section’ is closed to new replies.