]>
Commit | Line | Data |
---|---|---|
1 | (function(){ | |
2 | 'use strict'; | |
3 | ||
4 | var NAVS = { | |
5 | 'home': /^\/$/, | |
6 | 'pb': /^\/pb\//, | |
7 | 'ct': /^\/(?:ct|st)\//, | |
8 | 'log': /^\/log\//, | |
9 | 'us': /^\/us\//, | |
10 | 'account': /^\/account$/, | |
11 | }; | |
12 | ||
13 | $( document ).ready(function(){ | |
14 | var path = location.pathname; | |
15 | for (var nav in NAVS) | |
16 | if(path.match(NAVS[nav])) { | |
17 | $('#nav-' + nav).addClass('active'); | |
18 | break; | |
19 | } | |
20 | }); | |
21 | })(); |