-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (30 loc) · 751 Bytes
/
index.js
File metadata and controls
35 lines (30 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"use strict";
// alphabetical order
function sortUL(selector) {
var $ul = $(selector);
$ul
.find("li")
.sort(function (a, b) {
var upA = $(a).text().toUpperCase();
var upB = $(b).text().toUpperCase();
return upA < upB ? -1 : upA > upB ? 1 : 0;
})
.appendTo(selector);
}
$(document).ready(function () {
sortUL(".list-alphabetically-1");
sortUL(".list-alphabetically-2");
});
$("philodendron").add("");
const panels = document.querySelectorAll(".panel");
panels.forEach((panel) => {
panel.addEventListener("click", () => {
removeActiveClasses();
panel.classList.add("active");
});
});
function removeActiveClasses() {
panels.forEach((panel) => {
panel.classList.remove("active");
});
}