Add Close Accordion Function to Jquery Script -
i have script found here:
(function() { var $container = $('.acc-container'), $trigger = $('.acc-trigger'); $container.hide(); $trigger.first().addclass('active').next().show(); var fullwidth = $container.outerwidth(true); $trigger.css('width', fullwidth); $container.css('width', fullwidth); $trigger.on('click', function(e) { if( $(this).next().is(':hidden') ) { $trigger.removeclass('active').next().slideup(300); $(this).toggleclass('active').next().slidedown(300); } e.preventdefault(); }); // resize $(window).on('resize', function() { fullwidth = $container.outerwidth(true) $trigger.css('width', $trigger.parent().width() ); $container.css('width', $container.parent().width() ); }); })();
and can't figure out add ability not automatically reveal first tab?
you need this:
$('.acc-container').accordion({ active: false, collapsible: true });
Comments
Post a Comment