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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -