0

I am trying to edit this script to remove its function that you need to click the tab before showing the content. I want to display the default tab to display. Please assist! Here is the code:

<script>

$(document).ready(function() {
   $("#tabs li").click(function() {
       $("#tabs li").removeClass('active');
       $(this).addClass("active");
       $(".Tablist11").hide();
       var selected_tab = $(this).find("a").attr("href");
       $(selected_tab).fadeIn();
       return false;
   });
});

</script>
Cimbali
  • 11,012
  • 1
  • 39
  • 68
  • possible duplicate of [How to trigger('click') on jquery tab's currently active tab](http://stackoverflow.com/questions/10735423/how-to-triggerclick-on-jquery-tabs-currently-active-tab) or [jquery how to set first tab active](http://stackoverflow.com/questions/5624486/jquery-how-to-set-first-tab-active) – mplungjan Jan 18 '15 at 16:51

1 Answers1

0

Give your default tab a class active then add this line to you script to trigger clicking on that tab:

<script>

$(document).ready(function() {
   $("#tabs li").click(function() {
       $("#tabs li").removeClass('active');
       $(this).addClass("active");
       $(".Tablist11").hide();
       var selected_tab = $(this).find("a").attr("href");
       $(selected_tab).fadeIn();
       return false;
   });

   //add this line
   $("#tabs li.active").trigger("click");
});

</script>
poya
  • 1
  • 3