$(document).ready(function(){// FAQs AccordionaccordionList=function(){varallPanels=$('.accordion-list > dd').hide();$('.accordion-list > dt > a').click(function(){// Version 1 - StandardallPanels.slideUp();$(this).parent().next().slideDown();// End of v1// Version 2 - Prevent closing of current visible item$target=$(this).parent().next();if(!$target.hasClass('active')){allPanels.removeClass('active').slideUp();$target.addClass('active').slideDown();}// End of v2// Prevent default 'link' behaviourreturnfalse;})}accordionList();});
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.