diff options
Diffstat (limited to 'frontend/index.js')
| -rw-r--r-- | frontend/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/index.js b/frontend/index.js new file mode 100644 index 0000000..0cbd896 --- /dev/null +++ b/frontend/index.js @@ -0,0 +1,10 @@ +/// <reference path="scripts/jquery-3.5.1.min.js"/> + +function main() { + console.log('Document ready.'); + const lPathName = window.location.pathname.length > 1 && window.location.pathname.startsWith('/') ? window.location.pathname.substr(1) : window.location.pathname; + console.log(lPathName); + $('nav').find('a[href="' + lPathName + '"').addClass('nav-selected'); +} + +$(document).ready(main);
\ No newline at end of file |
