This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/site/static/main/js/account.js

29 lines
822 B
JavaScript

$(function(){
var _selected;
var _getSelected = function (text) {
if (text == '#acc-quit' || $('#acc-vacation') && text == '#acc-vacation') {
_selected = text;
} else {
_selected = '#acc-games';
}
};
var _display = function () {
$('#acc-quit').css('display', (_selected == '#acc-quit') ? 'block' : 'none');
if ($('#acc-vacation')) {
$('#acc-vacation').css('display', (_selected == '#acc-vacation') ? 'block' : 'none');
}
$('#acc-games').css('display', (_selected == '#acc-games') ? 'block' : 'none');
$('#tabs a' + _selected.replace(/acc-/, 'tab-')).addClass('selected');
};
_getSelected(location.hash);
_display();
$('#tabs a').click(function() {
$('#tabs a' + _selected.replace(/acc-/, 'tab-')).removeClass('selected');
_getSelected($(this).attr('href'));
_display();
});
});