jQuery(document).ready(function(){wordCountResize("body-text",50),wordCountResize("title-wrapper",10),wordCountResize("body-text",50),wordCountResize("title-wrapper",10)});
//# sourceMappingURL=block-min.js.map
;
jQuery(document).ready(function () {
var h2Counter = 1; // Initialize a counter for h2 elements
// Iterate through each .block-long-form-content-with-sidebar element
jQuery(".block-long-form-content-with-sidebar").each(function () {
var ul = jQuery("
"); // Create a new unordered list
// Find all h2 elements inside the .main-content div of the current block
jQuery(this)
.find(".main-content h2")
.each(function () {
// Generate a unique ID for each h2
var h2Id = "h2-number-" + h2Counter++;
jQuery(this).attr("id", h2Id);
var text = jQuery(this).text(); // Get the text of each h2
// Create an anchor link and list item for each h2
var li = jQuery("");
var anchor = jQuery("")
.attr("href", "#" + h2Id)
.text(text);
li.append(anchor);
ul.append(li);
});
// Append the unordered list to the .custom-links-false div of the current block
jQuery(this).find(".custom-links-false").append(ul);
});
// Smooth scroll function for links generated within .custom-links-false
jQuery('.custom-links-false a[href*="#"]').on("click", function (e) {
e.preventDefault();
var target = jQuery(this).attr("href"); // Get the target ID from href
if (jQuery(target).length) {
// Ensure the target element exists
jQuery("html, body").animate(
{
scrollTop: jQuery(target).offset().top - 115,
},
1000
);
}
});
// Click to open sidebar
jQuery(".block-long-form-content-with-sidebar .sidebar-title").on("click", function () {
jQuery(this).siblings("ul").slideToggle(500);
});
});
;