I have the Elementor Pro page builder plugin installed and I want to setup a expanding column so when a button is pressed it expands more Elementor sections.
I'm pretty certain this can be done with jQuery but can't get it to work properly.
I got the button to work using this code
jQuery( document ).on( 'click', '#MY_BTN', function( event ) {
event.preventDefault();
// Show/Hide the widget
jQuery( '#MY_WIDGET' ).toggle();
});
but I couldn't get the section to hide by default, how do I achieve this?
Many thanks
Thomas
I have the Elementor Pro page builder plugin installed and I want to setup a expanding column so when a button is pressed it expands more Elementor sections.
I'm pretty certain this can be done with jQuery but can't get it to work properly.
I got the button to work using this code
jQuery( document ).on( 'click', '#MY_BTN', function( event ) {
event.preventDefault();
// Show/Hide the widget
jQuery( '#MY_WIDGET' ).toggle();
});
but I couldn't get the section to hide by default, how do I achieve this?
Many thanks
Thomas
Share Improve this question asked Jun 2, 2019 at 21:46 thomasgardner47thomasgardner47 132 bronze badges1 Answer
Reset to default 0You can actually hide it on page load using jQuery ready()
method:
$(document).ready(function(){
$('#MY_WIDGET').hide();
});