
FAIR is a non-profit organization dedicated to providing well-documented answers to criticisms of the doctrine, practice, and history of The Church of Jesus Christ of Latter-day Saints.
MikeParker (talk | contribs) (Created page with "→Any JavaScript here will be loaded for all users on every page load.: $(document).ready(function () { // Buscar cada bloque que define el collapse $(".collapsible-header").each(function () { var header = $(this); var content = header.next(".collapsible-content"); // SOLO el siguiente bloque // Si no hay contenido asociado, ignorar if (content.length === 0) return; // Asegurar que empiece cerrado co...") |
MikeParker (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
// COLLAPSIBLE HEADER | |||
$(document).ready(function () { | $(document).ready(function () { | ||
$(".collapsible-header").each(function () { | $(".collapsible-header").each(function () { | ||
var header = $(this); | var header = $(this); | ||
var content = header.next(".collapsible-content"); | var content = header.next(".collapsible-content"); | ||
// Skip if there is no associated collapsible-content block | |||
// | |||
if (content.length === 0) return; | if (content.length === 0) return; | ||
// Check if the section should start open | |||
// | var startsOpen = header.hasClass("open"); | ||
content.hide(); | // Hide content only if it should start closed | ||
if (!startsOpen) { | |||
// | content.hide(); | ||
header.append(' <span class="collapse-toggle"> | } | ||
// Initial toggle indicator | |||
// | var indicator = startsOpen ? "[-]" : "[+]"; | ||
header.append(' <span class="collapse-toggle">' + indicator + '</span>'); | |||
// Make header clickable | |||
header.css("cursor", "pointer"); | header.css("cursor", "pointer"); | ||
// Collapse / Expand behavior | |||
// | |||
header.on("click", function () { | header.on("click", function () { | ||
content.slideToggle(200); | content.slideToggle(200); | ||
var toggle = header.find(".collapse-toggle"); | var toggle = header.find(".collapse-toggle"); | ||
toggle.text(toggle.text() === "[+]" ? "[-]" : "[+]"); | toggle.text(toggle.text() === "[+]" ? "[-]" : "[+]"); | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
/* Any JavaScript here will be loaded for all users on every page load. */
// COLLAPSIBLE HEADER
$(document).ready(function () {
$(".collapsible-header").each(function () {
var header = $(this);
var content = header.next(".collapsible-content");
// Skip if there is no associated collapsible-content block
if (content.length === 0) return;
// Check if the section should start open
var startsOpen = header.hasClass("open");
// Hide content only if it should start closed
if (!startsOpen) {
content.hide();
}
// Initial toggle indicator
var indicator = startsOpen ? "[-]" : "[+]";
header.append(' <span class="collapse-toggle">' + indicator + '</span>');
// Make header clickable
header.css("cursor", "pointer");
// Collapse / Expand behavior
header.on("click", function () {
content.slideToggle(200);
var toggle = header.find(".collapse-toggle");
toggle.text(toggle.text() === "[+]" ? "[-]" : "[+]");
});
});
});

FAIR is a non-profit organization dedicated to providing well-documented answers to criticisms of the doctrine, practice, and history of The Church of Jesus Christ of Latter-day Saints.
We are a volunteer organization. We invite you to give back.
Donate Now