Hi Support,
I’d like to implement collapsible section on my site, but despite trying pretty much every JS solution posted on the old forums I can’t get any success.
Effect I’m looking for:
User presses a button and a full size section expands below containing new content.
I tried this code in the JS editor (after giving the button, section ect the correct ID’s and classes), which looks like it SHOULD work:
jQuery(document).ready(function($){
$('#my-section.section-expandable').slideToggle(0);
$('#my-section-trigger-button').click(function(e){
e.preventDefault();
$('#my-section.section-expandable').slideToggle( "slow" );
});
});
Unfortunately all it does is hide the ‘’#my-section.section-expandable’ section before the page loads and when I press the button it just takes me to the top of the page. The section doesn’t appear or expand.
Do you have any suggestions?
Obviously all the code I tried are from posts which are over a year old - is this the reason they don’t work?
Thanks for the help,
Andy