Skip to content

Commit

Permalink
reverting to old tabs.js because others don't function correctly in IE8-
Browse files Browse the repository at this point in the history
  • Loading branch information
dhg committed Aug 18, 2011
1 parent 0ed1e6e commit 751c738
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions javascripts/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,36 @@
* 8/17/2011
*/


$(document).ready(function() {

/* Tabs Activiation
================================================= */
$('ul.tabs > li').live('click', function(e) {
var $tab = $(this);
var $href = $tab.find('a:first');
var $otherHrefs = $tab.siblings().find('a');
var contentLocation = $href.attr('href');

//Let go if not a hashed one
if(contentLocation[0]=="#") {
e.preventDefault();

$otherHrefs.removeClass('active');

//Make Tab Active
if (!$href.hasClass('active')){
$href.addClass('active');
}

//Show Tab Content & add active class
$(contentLocation)
.show()
.addClass('active')
.siblings()
.hide()
.removeClass('active');
}
================================================== */

var tabs = $('ul.tabs');

tabs.each(function(i) {

//Get all tabs
var tab = $(this).find('> li > a');
tab.click(function(e) {

//Get Location of tab's content
var contentLocation = $(this).attr('href');

//Let go if not a hashed one
if(contentLocation.charAt(0)=="#") {

e.preventDefault();

//Make Tab Active
tab.removeClass('active');
$(this).addClass('active');

//Show Tab Content & add active class
$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');

}
});
});
});

0 comments on commit 751c738

Please sign in to comment.