Hello,
Is it possible to hide a fullwidth color section, and show it with a button or link ?
Many thanks,
Jean
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
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
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
Hey,
Yes, it works!
Excellent support.
Thanks to you and all the team
Best regards,
Jean