Skip to content

Instantly share code, notes, and snippets.

@apipkin
Created February 19, 2010 21:23
Show Gist options
  • Save apipkin/309232 to your computer and use it in GitHub Desktop.
Save apipkin/309232 to your computer and use it in GitHub Desktop.
_switch : function(o){
try {
Y.log(64);
_scrollAnimation.stop();
Y.log(66);
}catch(e){
// do nothing
}
var group = window.location.hash || this._switchCookie() || '#components';
if(o != undefined) {
var group = o.get('href');
}else{
if(group.indexOf('#') < 0) {
group = '#' + group;
}
o = Y.one('#componentGroups a[href=' + group + ']');
}
group = group.substring(group.lastIndexOf('#') + 1);
Y.Cookie.set('MenuSwitch', group, { path: BASE_URL , expires: new Date("January 12, 2025")});
Y.all('#componentGroups li').removeClass('selected');
if(o != undefined) {
o.ancestor('li').addClass('selected');
}
if(Y.one('#scrollBody > div#' + group)) {
Y.all('#scrollBody > div').setStyle('display','none');
Y.one('#scrollBody > div#' + group).setStyle('display','');
}else{
Y.all('#scrollBody > div').setStyle('display','');
}
this._scrollBodyUpdate();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment