FAQ

/** Unique tabs using H6 as an anchor **/ document.addEventListener("DOMContentLoaded", function(event) { $($('.product-single__content-text').find('h6').get() .reverse()).each(function(i) { var tabName = $(this).text(); tabContent = ''; //check if h6 has text inside if ($(this).text() != '') { //hide h6 $(this).hide(); //combine content between H6 elements $(this).nextUntil('h6').each(function() { tabContent = tabContent + this.outerHTML; //hide content $(this).hide(); }); //generate tab HTML $('.js-accordion').prepend('† $('.js-accordion').prepend('

' + tabName + '

Open tab
† } else { //hide empty H6 $(this).hide(); † $(".js-unique-trigger").click(function() { var thisItem = $(this).attr("href"); var activeClass = "js-active"; //check if clicked is active if ($(thisItem).hasClass(activeClass)) { //close current item $(this).removeClass(activeClass); $(thisItem) .removeClass(activeClass) .stop() .slideUp(); } else { // open and activate this item $(thisItem) .addClass(activeClass) .stop() .slideDown(); $(this).addClass(activeClass); } return false; }); †