Commit 5f7fab64 authored by sbiego's avatar sbiego

added a js funct

parent 627ee94d
function toggleLang() {
var elementsIT = document.getElementsByClassName("desc_it");
var elementsEN = document.getElementsByClassName("desc_en");
lan_sel = document.getElementById("lang_select");
stateIT = elementsIT[0].style.display;
for (var i = 0; i < elementsIT.length; i++) {
if (stateIT == "none") {
elementsIT[i].style.display = "block";
elementsEN[i].style.display = "none";
}
else {
elementsIT[i].style.display = "none";
elementsEN[i].style.display = "block ";
}
}
if (stateIT == "none")
lan_sel.style.backgroundImage = 'url(../img/flaguk.png)';
else
lan_sel.style.backgroundImage = 'url(../img/flagit.png)';
}
function toggleLang(){var c=document.getElementsByClassName("desc_it");var a=document.getElementsByClassName("desc_en");lan_sel=document.getElementById("lang_select");stateIT=c[0].style.display;for(var b=0;b<c.length;b++){if(stateIT=="none"){c[b].style.display="block";a[b].style.display="none"}else{c[b].style.display="none";a[b].style.display="block "}}if(stateIT=="none"){lan_sel.style.backgroundImage="url(../img/flaguk.png)"}else{lan_sel.style.backgroundImage="url(../img/flagit.png)"}};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment