Commit dabe4e3e by Georgina Mondino

Funcion de Armar Tabs

1 parent 0bef61b1
...@@ -14,7 +14,7 @@ function ArmarForm() { ...@@ -14,7 +14,7 @@ function ArmarForm() {
boton.setAttribute("id", "Boton" + n); boton.setAttribute("id", "Boton" + n);
boton.setAttribute("value", n); boton.setAttribute("value", n);
boton.setAttribute("class", "Botones"); boton.setAttribute("class", "Botones");
boton.addEventListener("click", HabilitarTab); boton.setAttribute("onclick", HabilitarTab(this));
let ancho = ((100 - (0.2 * m)) / m) + "%"; let ancho = ((100 - (0.2 * m)) / m) + "%";
boton.style.width = ancho; boton.style.width = ancho;
let tab = document.createElement("div"); let tab = document.createElement("div");
...@@ -27,10 +27,21 @@ function ArmarForm() { ...@@ -27,10 +27,21 @@ function ArmarForm() {
document.getElementById("Tab0").style.display="block"; document.getElementById("Tab0").style.display="block";
} }
function HabilitarTab() { function HabilitarTab(elemento) {
for (n = 0; n < m; n++) { let IDBoton= elemento.id;
document.getElementById("Tab" + n).style.display="none" var i, Tabs, Botones;
if(doc){}
} Tabs = document.getElementsByClassName("Tabs");
for (i = 0; i < Tabs.length; i++) {
Tabs[i].style.display = "none";
}
Botones = document.getElementsByClassName("Botones");
for (i = 0; i < Botones.length; i++) {
Botones[i].className = Botones[i].className.replace(" BotonesActive", "");
}
document.getElementById(IDBoton).style.display = "block";
evt.currentTarget.className += " active";
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ html { ...@@ -21,7 +21,7 @@ html {
margin: 0.1%; margin: 0.1%;
} }
.Botones:active { .BotonesActive {
background-color: var(--Color); background-color: var(--Color);
border-bottom: none; border-bottom: none;
height: 6%; height: 6%;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!