Browse files

release 1.0.2

  • Loading branch information...
1 parent 52cb216 commit 843b65e22a49a9f049d9ff644ecb96a27a0be243 @anthonyettinger anthonyettinger committed Feb 21, 2012
View
BIN img/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN releases/jquery.tabbed-1.0.2.tgz
Binary file not shown.
View
BIN releases/jquery.tabbed-1.0.2/img/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
22 releases/jquery.tabbed-1.0.2/jquery.tabbed.css
@@ -0,0 +1,22 @@
+/*!
+ * jQuery.tabbed() v1.0.2
+ * https://github.com/chovy/tabbed-navigation
+ *
+ * Copyright 2012, Anthony Ettinger
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Date: Tue Feb 14 19:48:04 PST 2012
+ */
+.tabbed .tabs:after, .clfx:after { content: '.'; display: block; visibility: hidden; overflow: hidden; clear: both; font-size: 0; height: 0; }
+
+.tabbed { }
+.tabbed .tabs, .tabbed .tabs li, .tabbed .tabs a { display: block; }
+.tabbed .tabs { list-style-type: none; padding-left: 20px; }
+.tabbed .tabs li { border: 1px solid black; border-radius: 5px 5px 0 0; float: left; border-bottom: none; margin-right: 10px; }
+.tabbed .tabs a { padding: 5px 10px; text-decoration: none; }
+.tabbed .tabs a, .tabbed .tabs a:active, .tabbed .tabs a:focus { outline: none; }
+.tabbed .tabs .active a { margin-bottom: -1px; border-bottom: 1px solid white; }
+.tabbed .contents { border: 1px solid black; border-radius: 5px; }
+.tabbed .content { display: none; padding: 20px; }
+.tabbed .content:first-child { display: block; }
+.tabbed .content.loading { background: url('img/loading.gif') no-repeat 50% 50%; }
View
10 releases/jquery.tabbed-1.0.2/jquery.tabbed.ie.css
@@ -0,0 +1,10 @@
+/*!
+ * jQuery.tabbed() v1.0.2
+ * https://github.com/chovy/tabbed-navigation
+ *
+ * Copyright 2012, Anthony Ettinger
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Date: Tue Feb 14 19:48:04 PST 2012
+ */
+.tabbed .tabs, .clfx { zoom: 1; }
View
62 releases/jquery.tabbed-1.0.2/jquery.tabbed.js
@@ -0,0 +1,62 @@
+/*!
+ * jQuery.tabbed() v1.0.2
+ * https://github.com/chovy/tabbed-navigation
+ *
+ * Copyright 2012, Anthony Ettinger
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Date: Tue Feb 14 19:48:04 PST 2012
+ */
+(function($){
+ $.fn.extend({
+ tabbed: function( opts ) {
+
+ //default options
+ var opts = $.extend({
+ }, opts);
+
+ var activateTab = function( tab, tabContent, tabs, tabContents ){
+ var url = tab.find('a').attr('href').split('#');
+
+ //make the first tab active
+ tabs.removeClass('active');
+ tab.addClass("active");
+
+ //hide all but the first tab contents
+ tabContents.hide();
+
+ //we have a url, do ajax call
+ if ( url[0] ) {
+ tabContent.html('');
+ tabContent.show();
+ tabContent.addClass('loading').load(url[0], function(){
+ tabContent.removeClass('loading');
+ });
+ } else {
+ tabContent.show();
+ }
+ };
+
+ return this.each(function() {
+ var obj = $(this);
+ var tabs = $('.tabs li', obj),
+ tabContents = $('.contents .content', obj),
+ firstTab = tabs.eq(0),
+ firstContent = tabContents.eq(0);
+
+ activateTab(firstTab, firstContent, tabs, tabContents);
+
+ //handle the tab clicks
+ tabs.click(function(e) {
+
+ var current = tabs.index($(this)),
+ currentContent = tabContents.eq(current);
+
+ e.preventDefault();
+
+ activateTab( $(this), currentContent, tabs, tabContents );
+ });
+ });
+ }
+ });
+})(jQuery);

0 comments on commit 843b65e

Please sign in to comment.