From 49f5657d936e352112fdcfa61473f5f38cda1c14 Mon Sep 17 00:00:00 2001 From: Shuaib Hanief Date: Tue, 31 Dec 2013 22:54:56 -0500 Subject: add a theme based on the new Zurb Foundation 5 framework --- .../static/js/foundation/foundation.tab.js | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 zurb-F5-basic/static/js/foundation/foundation.tab.js (limited to 'zurb-F5-basic/static/js/foundation/foundation.tab.js') diff --git a/zurb-F5-basic/static/js/foundation/foundation.tab.js b/zurb-F5-basic/static/js/foundation/foundation.tab.js new file mode 100644 index 0000000..f3dff80 --- /dev/null +++ b/zurb-F5-basic/static/js/foundation/foundation.tab.js @@ -0,0 +1,37 @@ +/*jslint unparam: true, browser: true, indent: 2 */ +;(function ($, window, document, undefined) { + 'use strict'; + + Foundation.libs.tab = { + name : 'tab', + + version : '5.0.1', + + settings : { + active_class: 'active' + }, + + init : function (scope, method, options) { + this.bindings(method, options); + }, + + events : function () { + $(this.scope).off('.tab').on('click.fndtn.tab', '[data-tab] > dd > a', function (e) { + e.preventDefault(); + + var tab = $(this).parent(), + target = $('#' + this.href.split('#')[1]), + siblings = tab.siblings(), + settings = tab.closest('[data-tab]').data('tab-init'); + + tab.addClass(settings.active_class); + siblings.removeClass(settings.active_class); + target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class); + }); + }, + + off : function () {}, + + reflow : function () {} + }; +}(jQuery, this, this.document)); -- cgit