1

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

0

You can actually hide it on page load using jQuery ready() method:

$(document).ready(function(){
  $('#MY_WIDGET').hide();
});
  • Hello Magefms, I have tried using that code in my custom javascript plugin but no luck. – thomasgardner47 Jun 8 at 9:02
  • is #MY_WIDGET the id of the section? – magefms Jun 8 at 10:17
  • Hi magefms, yes but once clicking on the button it disapears. – thomasgardner47 Jun 8 at 12:19
  • can you show me the section code? you can actually set the default visibility by an in-line CSS style – magefms Jun 8 at 12:44
  • Hi magefms, of course i can, but ill have to provide a link to an image screenshot of the code which I hope will be suitable. link – thomasgardner47 Jun 8 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.