Home › Forums › WoodMart support forum › Single product tabs › Reply To: Single product tabs
August 2, 2022 at 10:13 pm
#395117
Elise Noromit
Member
Hello,
Please replace the code with this one:
if (jQuery(window).width() <= 1024) {
setTimeout( function(){
jQuery('.woocommerce-tabs.wd-accordion').each(function() {
let activeClass = 'wd-active';
let time = 300;
let firstItem = jQuery('.wd-accordion > .wd-accordion-item').first();
let secondItem = firstItem.next();
let getTitle = $item => $item.find('> .wd-accordion-title');
let getContent = $item => $item.find('> .wd-accordion-content');
getTitle( firstItem ).removeClass(activeClass);
getContent( firstItem ).stop(true, true).slideUp(time).removeClass(activeClass);
getTitle( secondItem ).addClass(activeClass);
getContent( secondItem ).stop(true, true).slideDown(time).addClass(activeClass);
jQuery(this).addClass('wd-inited');
});
}, 500);
}
Best Regards