Sha256: 531a5178a3285cae757b83a65b7a72de7c3bea88e4544b78e8fdaa9d7799420c
Contents?: true
Size: 1.14 KB
Versions: 11
Compression:
Stored size: 1.14 KB
Contents
;(function ($, window, undefined) { 'use strict'; $.fn.foundationTabs = function (options) { var settings = $.extend({ callback: $.noop }, options); var activateTab = function ($tab) { var $activeTab = $tab.closest('dl, ul').find('.active'), target = $tab.children('a').attr("href"), hasHash = /^#/.test(target), contentLocation = ''; if (hasHash) { contentLocation = target + 'Tab'; // Strip off the current url that IE adds contentLocation = contentLocation.replace(/^.+#/, '#'); //Show Tab Content $(contentLocation).closest('.tabs-content').children('li').removeClass('active').hide(); $(contentLocation).css('display', 'block').addClass('active'); } //Make Tab Active $activeTab.removeClass('active'); $tab.addClass('active'); }; $(document).on('click.fndtn', '.tabs a', function (event){ activateTab($(this).parent('dd, li')); }); if (window.location.hash) { activateTab($('a[href="' + window.location.hash + '"]').parent('dd, li')); settings.callback(); } }; })(jQuery, this);
Version data entries
11 entries across 11 versions & 3 rubygems