Echipament script.js: Diferență între versiuni

De la Wiki The-West RO
Jump to navigation
Fără descriere a modificării
Fără descriere a modificării
Linia 1: Linia 1:
$(function showCat(evt, catName) {
$(document).ready(function(){
var i, catBox_text, catBox_new;
$(function showCat(evt, catName) {
var i, catBox_text, catBox_new;
catBox_text = document.getElementsByClassName("catBox_text");
for (i = 0; i < catBox_text.length; i++) {
catBox_text[i].style.display = "none";
}
catBox_new = document.getElementsByClassName("catBox_new");
for (i = 0; i < catBox_new.length; i++) {
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
}
document.getElementById(catName).style.display = "block";
evt.currentTarget.className += " active";
document.getElementById("main_text").style.display = "none";
});


$(function reverse(ev, catName) {
catBox_text = document.getElementsByClassName("catBox_text");
var i, catBox_text, catBox_new;
for (i = 0; i < catBox_text.length; i++) {
catBox_text[i].style.display = "none";
catBox_text = document.getElementsByClassName("catBox_text");
}
for (i = 0; i < catBox_text.length; i++) {
 
catBox_text[i].style.display = "none";
catBox_new = document.getElementsByClassName("catBox_new");
}
for (i = 0; i < catBox_new.length; i++) {
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
catBox_new = document.getElementsByClassName("catBox_new");
}
for (i = 0; i < catBox_new.length; i++) {
 
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
document.getElementById(catName).style.display = "block";
}
evt.currentTarget.className += " active";
 
document.getElementById("main_text").style.display = "block";
document.getElementById("main_text").style.display = "none";
});
 
$(function reverse(ev, catName) {
var i, catBox_text, catBox_new;
 
catBox_text = document.getElementsByClassName("catBox_text");
for (i = 0; i < catBox_text.length; i++) {
catBox_text[i].style.display = "none";
}
 
catBox_new = document.getElementsByClassName("catBox_new");
for (i = 0; i < catBox_new.length; i++) {
catBox_new[i].className = catBox_new[i].className.replace(" active", "");
}
 
document.getElementById("main_text").style.display = "block";
});
});
});

Versiunea de la data 6 septembrie 2021 09:54

$(document).ready(function(){ $(function showCat(evt, catName) { var i, catBox_text, catBox_new;

catBox_text = document.getElementsByClassName("catBox_text"); for (i = 0; i < catBox_text.length; i++) { catBox_text[i].style.display = "none"; }

catBox_new = document.getElementsByClassName("catBox_new"); for (i = 0; i < catBox_new.length; i++) { catBox_new[i].className = catBox_new[i].className.replace(" active", ""); }

document.getElementById(catName).style.display = "block"; evt.currentTarget.className += " active";

document.getElementById("main_text").style.display = "none"; });

$(function reverse(ev, catName) { var i, catBox_text, catBox_new;

catBox_text = document.getElementsByClassName("catBox_text"); for (i = 0; i < catBox_text.length; i++) { catBox_text[i].style.display = "none"; }

catBox_new = document.getElementsByClassName("catBox_new"); for (i = 0; i < catBox_new.length; i++) { catBox_new[i].className = catBox_new[i].className.replace(" active", ""); }

document.getElementById("main_text").style.display = "block"; }); });