pedf
/
fakulta-online
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

20 lines
640 B
JavaScript

filterSelection("all");
function filterSelection(c) {
var x = document.getElementsByClassName("program");
if (c == "all") c = "";
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("show");
if (x[i].className.indexOf(c) >= 0) x[i].classList.add("show");
}
}
var btnContainer = document.getElementById("filters");
var btns = btnContainer.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}