Hi am currently using the code below for an expandable footer on my site.
I would like to adapt it so that when the link class '.toggle' is clicked it will add a class called '.is-open' to the element so far the code does this but then additionally I would like the code to add the class '.is-open' to another class called '.footercontrol'
$(".footer, .toggle:not(:first-child)").hide();
$(".toggle").click(function(e) {
e.preventDefault();
if ( $(this).hasClass("is-open") ){
$(this).removeClass("is-open").nextAll(".footer, .toggle:not(:first- child)").slideUp(500).removeClass("is-open");
return;
}
$(this).toggleClass("is-open");
$(this).next(".footer").slideToggle(500).next(".toggle").slideToggle(500);
$("html, body").animate({
scrollTop: $(document).height()
}, 500);
});
Thanks in advance :)