Skip to content

Commit

Permalink
Fixed error occuring on first load of the page
Browse files Browse the repository at this point in the history
  • Loading branch information
Max committed Oct 12, 2017
1 parent 6542675 commit c9ba027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions header.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function setActiveClass() {
try {
pageId += document.location.href.match(/[^\/]+$/)[0].split(".")[0];
} catch (err) {
pageId = $(".headerUl").firstChild().attr("id");
pageId = $(".headerUl").children().first().children().first().attr("href");
pageId = "#"+pageId.split(".")[0];
}
$(pageId).attr("class", "aktiv");
}
Expand All @@ -42,7 +43,6 @@ function setElementsSize() {
if ($(window).width() < 800) {
$(".headerUl").css("width", descriptionWidth);
$(".headerUl").children().css("width", descriptionWidth);
//$(".headerUl:last-child").css("width", descriptionWidth);
} else {
$(".headerUl").css("width", "85%");
$(".headerUl").children().css("width", descriptionWidth);
Expand Down

0 comments on commit c9ba027

Please sign in to comment.