I’m looking for some help on how to auto-open an accordion module upon clicking a link (on an image). See image below for what I’m looking for specifically. Here is the Jscript:
$('.accordion-content').hide();
$('.expand .accordion-content').show();
$('.accordion-title').click(function(){
$(this).closest('.hs_cos_wrapper_type_custom_widget').siblings().find('.hs-accordion-wrapper').removeClass('expand');
$(this).parent().addClass('expand');
$(this).next().slideToggle(250);
var title = $('.accordion-title');
title.each(function(){
$(this).click(function(){
$(this).parent().toggleClass('expand');
});
});
});
});
$(window).load(function() {
$(".hs-tab-content").each(function(b) {
var a = $(this).closest(".hs_cos_wrapper_type_custom_widget").html();
$(this).closest(".hs_cos_wrapper_type_custom_widget").before(a);
$(this).closest(".hs_cos_wrapper_type_custom_widget").remove()
});
$(".hs-tab-content").wrapAll('<div class="hs-tabber-content"></div>');
$(".hs-tabber-content").wrapAll('<div class="hs-tabber-wrap"></div>');
$(".hs-tabber-content .hs-tab-content").each(function(a, b) {
$(b).attr("id", "tab-" + a);
var c = $(b).find(".tab-list").html();
//$(this).find('.tab-list').remove();
$(b).closest(".hs-tabber-wrap").append('<li class="hs-tab col-3"><a> ' + c + " </a></li>")
});
$(".hs-tab-content > h3.hs-tab-title").remove();
$(".hs-tabber-wrap").children("li").wrapAll('<ul class="clearfix hs-tabber-tabs"></ul>');
ul = $(".hs-tabber-tabs");
ul.children().each(function(b, a) {
ul.append(a)
});
$("ul.hs-tabber-tabs li:first").addClass("active");
$('.hs-tab-content:first').addClass("active");
$(".hs-tab-content").not(".active").hide();
$(".hs-tabber-tabs a").each(function(b, c) {
$(c).attr("href", "#tab-" + b);
var a = $(c).attr("href");
$(this).click(function(d) {
d.preventDefault();
if (!$(this).parent().hasClass("active")) {
$(this).parent().addClass("active").siblings().removeClass("active");
$(a).fadeIn().addClass("active").siblings().removeClass("active").hide();
}
});
});
});