Skip to content

Instantly share code, notes, and snippets.

@keithpitty
Created March 31, 2009 06:20
Show Gist options
  • Save keithpitty/88084 to your computer and use it in GitHub Desktop.
Save keithpitty/88084 to your computer and use it in GitHub Desktop.
getInitialTab : function() {
var active = $$(".active-tab");
if(active.length) {
return active.first().down();
} else {
if(document.location.href.match(/#(\w.+)/)) {
var loc = RegExp.$1;
var elm = this.menu.find(function(value) { return value.href.match(/#(\w.+)/)[1] == loc; });
return elm || this.menu.first();
} else {
return this.menu.first();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment