Two instances of one iner one Tabs on one page

Two instances of one iner one Tabs on one page

Dear All,


I have the need for two separate one iner one tabs on one page, any ideas how I can do this?

please check below code

JS

  1. <script type="text/javascript">//<![CDATA[ 
  2. window.addEvent('load', function() {
  3. $("#simple-tabs .tab_content").hide(); //Hide all content
  4. $("#simple-tabs ul.tabs li:first").addClass("active").show(); //Activate first tab
  5. $("#simple-tabs .tab_content:first").show(); //Show first tab content
  6. //On Click Event
  7. $("#simple-tabs ul.tabs li").click(function(e) {
  8.     $("#simple-tabs ul.tabs li").removeClass("active"); //Remove any "active" class
  9.     $(this).addClass("active"); //Add "active" class to selected tab
  10.     $("#simple-tabs .tab_content").hide(); //Hide all tab content
  11.     var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  12.     $(activeTab).fadeIn(); //Fade in the active content
  13.         $('.video-container iframe[src*="http://www.youtube.com/embed/"]').each(function(i) {
  14.             this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
  15.         });
  16.     e.preventDefault();
  17. });


  18. (function($) {
  19.     $('.tab ul.tabs li:first-child a').addClass('current');
  20.     $('.tab .tab_content div.tabs_tab:first-child').show();

  21.     $('.tab ul.tabs li a').click(function(g) {
  22.         var tab = $(this).parent().parent().parent(),
  23.             index = $(this).parent().index();

  24.         tab.find('ul.tabs').find('a').removeClass('current');
  25.         $(this).addClass('current');

  26.         tab.find('.tab_content').find('div.tabs_tab').not('div.tabs_tab:eq(' + index + ')').slideUp();
  27.         tab.find('.tab_content').find('div.tabs_tab:eq(' + index + ')').slideDown();

  28.         g.preventDefault();

  29.     });
  30. })(jQuery);
  31. });//]]>  
  32. </script>




HTML

  1. <div id="simple-tabs">
  2.                      <ul class="tabs">
  3.                         <li><a href="#tab1">Simple Slider</a></li>
  4.                         <li><a href="#tab2">Static Image</a></li>
  5.                         <li><a href="#tab3">Embedded Video</a></li>
  6.                      </ul>
  7.                      <div class="tab_container">
  8.                      
  9.                      <div id="tab1" class="tab_content">
  10.             
  11.             
  12.             
  13.             Tab1
  14.             
  15.             
  16.             
  17.                         </div>                     
  18.                         
  19.                         <div id="tab2" class="tab_content">
  20.           Tab2
  21.                         </div>
  22.                         <div id="tab3" class="tab_content">
  23.                Tab3
  24.                         </div>
  25.                      </div>
  26.                      <div class="clear"></div>
  27.                   </div>




CSS



  1. /* Tabs
  2. ---------------------------------------- */
  3. #simple-tabs ul.tabs
  4. {
  5.   margin-right:40px;
  6.   margin-left:50px;
  7.   padding:0;
  8.   float:left;
  9.   list-style:none;
  10.   height:58px;
  11.   width:100%;
  12. }

  13. #simple-tabs ul.tabs li
  14. {
  15.   float:left;
  16.   margin-right:10px;
  17.   padding:0;
  18.   height:54px;
  19.   line-height:54px;
  20.   margin-bottom:-1px;
  21.   overflow:hidden;
  22.   position:relative;
  23.   background:#5d6872;
  24. }

  25. #simple-tabs ul.tabs li a
  26. {
  27.   text-decoration:none;
  28.   display:block;
  29.   padding:0 30px;
  30.   outline:none;
  31.   color:#FFF;
  32. }


  33. #simple-tabs ul.tabs li a:hover
  34. {
  35.   background:#CCC;
  36. }


  37. #simple-tabs ul.tabs li.active
  38. {
  39.   background:#FFF;
  40.   border:1px dotted #CCC;
  41.   border-bottom: none;
  42.   height:58px;
  43. }

  44. #simple-tabs ul.tabs li.active a
  45. {
  46.   color:#555;
  47. }


  48. #simple-tabs ul.tabs li.active a:hover
  49. {
  50.   background: none;
  51. }

  52. #simple-tabs .tab_container
  53. {
  54.   border-top:1px dotted #ccc;
  55.   overflow:hidden;
  56.   clear:both;
  57.   float:left;
  58.   width:100%;
  59.   background:#FFF;
  60. }


  61. #simple-tabs .tab_content
  62. {
  63.   padding:70px 50px 0 50px;
  64. }