Q: making first tab active using jscrollpane Hi there got this from jscrollpane but can't figure out how to make the first tab active and it does not show information until clicked. I know what code i have to put it i just dont know where or what i have to take out to make it work
$(function()
   {
    // Create the "tabs"
    $('.tabs').each(
     function()
     {
  var currentTab, ul = $(this);
  $(this).find('a').each(
   function(i)
   {
    var a = $(this).bind(
     'click',
     function()
     {
      $("ul.tabs li:first").addClass('active').show();
      if (currentTab) {
       ul.find('a.active').removeClass('active');

       $(currentTab).hide();
      }
      currentTab = $(this).addClass('active')
          .attr('href');
      $(currentTab).show().jScrollPane();
      return false;
     }
    );
    $(a.attr('href')).hide();

   }

  );
 }
);

});

A: $('.tabs').each(
    function()
    {
        var currentTab, ul = $(this);
        $(this).find('a').each(
            function(i)
            {
                var a = $(this).bind(
                    'click',
                    function()
                    {
                        if (currentTab) {
                            ul.find('a.active').removeClass('active');
                            $(currentTab).hide();
                        }

                        currentTab = $(this).addClass('active')
                                        .attr('href');
                        $(currentTab).show().jScrollPane({
                                        showArrows: true,
                                        verticalGutter: 10,
                                        animateScroll: true,
                                        verticalDragMinHeight: 34,
                                        verticalDragMaxHeight: 34
                        });
                        return false;
                    }
                );
                $(a.attr('href')).hide();
            }
        );
    }
).find('a:first').trigger('click');

Using ('a:first') instead of .first() worked for me.

A: You could simply trigger a click on the first link found. e.g.
$('.tabs').each(
    function()
    {
        var currentTab, ul = $(this);
        $(this).find('a').each(
            function(i)
            {
                var a = $(this).bind(
                    'click',
                    function()
                    {
                        if (currentTab) {
                            ul.find('a.active').removeClass('active');
                            $(currentTab).hide();
                        }
                        currentTab = $(this).addClass('active')
                                        .attr('href');
                        $(currentTab).show().jScrollPane();
                        return false;
                    }
                );
                $(a.attr('href')).hide();
            }
        );
    }
).first().find('a').trigger('click');

(note the changes on the last line)
