[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/admin/jscripts/ -> tabs.js (source)

   1  $(function()
   2  {
   3      $('ul.tabs').each(function()
   4      {
   5          if($(this).data('rendered'))
   6          {
   7              return;
   8          }
   9  
  10          $(this).data('rendered', 'yes');
  11  
  12          var activeTab, activeContent, links = $(this).find('a');
  13  
  14          activeTab = $(links.filter('[href="'+location.hash+'"]')[0] || links[0]);
  15          activeTab.addClass('active');
  16          activeContent = $(activeTab.attr('href'));
  17  
  18          // Hide the remaining content
  19          links.not(activeTab).each(function()
  20          {
  21              $($(this).attr('href')).hide();
  22          });
  23  
  24          // Tab functionality
  25          $(this).on('click', 'a', function(e)
  26          {
  27              activeTab.removeClass('active');
  28              activeContent.hide();
  29  
  30              activeTab = $(this);
  31              activeContent = $($(this).attr('href'));
  32  
  33              // update address bar
  34              window.location.hash = $(this).attr('href');
  35  
  36              activeTab.addClass('active');
  37              activeContent.show();
  38  
  39              e.preventDefault();
  40          });
  41      });
  42  
  43  });


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref