PageSourceSearch

https://hydroterra.com.au/wp-content/themes/hydroterra_live/scripts/faq.js?ver=1.1.1

js hydroterra.com.au collected 2026-09-29 23:21:38 UTC 1,783 bytes, 74 lines download raw bytes

1jQuery(document).ready(function ($) {
2	document.querySelectorAll(".faq-module").forEach((module) => {
3		const buttons = module.querySelectorAll(".faq-module__question");
4
5		const closeItem = (button) => {
6			const answerId = button.getAttribute("aria-controls");
7			const answer = answerId ? document.getElementById(answerId) : null;
8
9			if (!answer) {
10				return;
11			}
12
13			button.setAttribute("aria-expanded", "false");
14
15			answer.style.height = `${answer.scrollHeight}px`;
16
17			requestAnimationFrame(() => {
18				answer.style.height = "0px";
19			});
20
21			const handleClose = () => {
22				answer.hidden = true;
23				answer.removeEventListener("transitionend", handleClose);
24			};
25
26			answer.addEventListener("transitionend", handleClose);
27		};
28
29		const openItem = (button) => {
30			const answerId = button.getAttribute("aria-controls");
31			const answer = answerId ? document.getElementById(answerId) : null;
32
33			if (!answer) {
34				return;
35			}
36
37			button.setAttribute("aria-expanded", "true");
38			answer.hidden = false;
39			answer.style.height = "0px";
40
41			requestAnimationFrame(() => {
42				answer.style.height = `${answer.scrollHeight}px`;
43			});
44
45			const handleOpen = () => {
46				answer.style.height = "auto";
47				answer.removeEventListener("transitionend", handleOpen);
48			};
49
50			answer.addEventListener("transitionend", handleOpen);
51		};
52
53		buttons.forEach((button) => {
54			button.addEventListener("click", () => {
55				const isOpen = button.getAttribute("aria-expanded") === "true";
56
57				buttons.forEach((otherButton) => {
58					if (
59						otherButton !== button &&
60						otherButton.getAttribute("aria-expanded") === "true"
61					) {
62						closeItem(otherButton);
63					}
64				});
65
66				if (isOpen) {
67					closeItem(button);
68				} else {
69					openItem(button);
70				}
71			});
72		});
73	});
74});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.