added code to highlight current page
This commit is contained in:
@@ -12,4 +12,18 @@ $(document).ready(function() {
|
||||
$(".textlink").mouseleave(function() {
|
||||
$(this).animate({"color": "black", "font-size": "100%"}, 200)
|
||||
})
|
||||
});
|
||||
setTimeout(highlightLocation, 200)
|
||||
});
|
||||
|
||||
function highlightLocation () {
|
||||
let pagename = $(location).attr('pathname')
|
||||
if (pagename.slice(0, 8) == "/project") {
|
||||
$('#projects').css("background-color", "darkblue")
|
||||
} else if (pagename.slice(0, 6) == "/about") {
|
||||
$('#about').css("background-color", "darkblue")
|
||||
} else if (pagename == "/" || pagename == "/index.html") {
|
||||
$('#home').css("background-color", "darkblue")
|
||||
} else if (pagename == "/support.html") {
|
||||
$('#support').css("background-color", "darkblue")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user