From c6deac85b68a2e25f25c58e39781537aac31bb9d Mon Sep 17 00:00:00 2001 From: tix Date: Thu, 12 Jan 2017 15:57:35 +0800 Subject: [PATCH] + left nav active style --- views/ei.html | 8 +++++++- views/intro.html | 8 +++++++- views/origin.html | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/views/ei.html b/views/ei.html index 1b69b96..09e36c2 100644 --- a/views/ei.html +++ b/views/ei.html @@ -19,9 +19,15 @@ }); $('.navbar-nav li a').each(function () { if ($(this).attr('href') == '/ei') { - console.log($(this).parent().addClass('active')); + $(this).parent().addClass('active'); } }); + $('.treeview ul.list-group li a').each(function () { + if ($($(this))[0].href == String(window.location)) { + $(this).parent().css("color", "#fff"); + $(this).parent().css("background-color", "#428bca"); + } + }) }); <%- include('comm/footer.html') %> \ No newline at end of file diff --git a/views/intro.html b/views/intro.html index 8cb6fe2..1ba39ed 100644 --- a/views/intro.html +++ b/views/intro.html @@ -19,9 +19,15 @@ }); $('.navbar-nav li a').each(function () { if ($(this).attr('href') == '/intro') { - console.log($(this).parent().addClass('active')); + $(this).parent().addClass('active'); } }); + $('.treeview ul.list-group li a').each(function () { + if ($($(this))[0].href == String(window.location)) { + $(this).parent().css("color", "#fff"); + $(this).parent().css("background-color", "#428bca"); + } + }) }); <%- include('comm/footer.html') %> diff --git a/views/origin.html b/views/origin.html index 23ec7aa..f0738f0 100644 --- a/views/origin.html +++ b/views/origin.html @@ -21,7 +21,13 @@ }); $('.navbar-nav li a').each(function () { if ($(this).attr('href') == '/origin') { - console.log($(this).parent().addClass('active')); + $(this).parent().addClass('active'); + } + }); + $('.treeview ul.list-group li a').each(function () { + if ($($(this))[0].href == String(window.location)) { + $(this).parent().css("color", "#fff"); + $(this).parent().css("background-color", "#428bca"); } }); });