-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: multi-language without full reload of page
- Loading branch information
1 parent
41b95dc
commit 8455d30
Showing
3 changed files
with
65 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function toggleLang() { | ||
var german = document.getElementById("main-de"); | ||
var english = document.getElementById("main-en"); | ||
|
||
var lang_divs = [german, english]; | ||
|
||
for (i=0; i < lang_divs.length; i++) { | ||
if (lang_divs[i].classList.contains("hidden")) { | ||
lang_divs[i].style.display = "block"; | ||
} else { | ||
lang_divs[i].style.display = "none"; | ||
} | ||
lang_divs[i].classList.toggle("hidden"); | ||
} | ||
} |