projects
/
gruntmaster-page.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Highlight current nav via javascript
[gruntmaster-page.git]
/
js
/
90-nav.js
1
(
function
(){
2
'use strict'
;
3
4
var
NAVS
= {
5
'home'
:
/^\/$/
,
6
'pb'
:
/^\/pb\//
,
7
'ct'
:
/^\/ct\//
,
8
'log'
:
/^\/log\//
,
9
'account'
:
/^\/account$/
10
};
11
12
$(
document
).
ready
(
function
(){
13
var
path
=
location
.
pathname
;
14
for
(
var
nav
in
NAVS
)
15
if
(
path
.
match
(
NAVS
[
nav
])) {
16
$(
'#nav-'
+
nav
).
addClass
(
'active'
);
17
break
;
18
}
19
});
20
})();
This page took
0.019889 seconds
and
4
git commands to generate.