Top nav buttons
UI improvement: Top nav buttons now show "active" when user is on their respective page.
This commit is contained in:
@@ -158,6 +158,11 @@ button:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.topnav .button-hover {
|
||||
background-color: rgb(219, 295, 235) !important;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.topnav .icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,20 @@
|
||||
</form>
|
||||
<button href="javascript:void(0);" class="icon" onclick="myFunction()"><img src="images/menu.png"></button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var topbuttons = document.querySelectorAll("button[form='views']");
|
||||
if(window.location.search.substr(1) != '') {
|
||||
for (var i = 0; i < topbuttons.length; i++) {
|
||||
if(topbuttons[i].value == decodeURIComponent(window.location.search.substr(1)).replace(/\+/g,' ').split('=').pop()) {
|
||||
topbuttons[i].classList.add("button-hover");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
topbuttons[0].classList.add("button-hover");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="views">
|
||||
<?php
|
||||
if(isset($_GET['view'])){
|
||||
|
||||
Reference in New Issue
Block a user