PageSourceSearch

https://professionalsecurity.co.uk/wp-content/themes/soledad-child/js/st-accordions.js

js professionalsecurity.co.uk collected 2026-10-02 07:42:55 UTC 2,815 bytes, 73 lines download raw bytes

1jQuery( document ).ready(function($) {
2    $('.st-accordions').each(function() {
3        var accordion = $(this);
4
5        accordion.find('.inner-wrapper').on('click', function() {
6            var hiddenContent = $(this).next('.hidden-content');
7            var icon = $(this).find('.icon');
8            var accordionItem = $(this).closest('.accordion-item');
9
10            if (hiddenContent.hasClass('active')) {
11                // Close the currently active item in this accordion
12                hiddenContent.removeClass('active').animate(
13                    { height: 0, opacity: 0 },
14                    {
15                        duration: 300,
16                        complete: function() {
17                            $(this).css('display', 'none');
18                        }
19                    }
20                );
21                icon.removeClass('active');
22                accordionItem.removeClass('active');
23            } else {
24                // Close any currently active accordion items within this group
25                accordion.find('.hidden-content.active').removeClass('active').animate(
26                    { height: 0, opacity: 0 },
27                    {
28                        duration: 300,
29                        complete: function() {
30                            $(this).css('display', 'none');
31                        }
32                    }
33                );
34
35                accordion.find('.inner-wrapper .icon.active').removeClass('active');
36                accordion.find('.accordion-item.active').removeClass('active');
37
38                // Temporarily show the content to measure its height
39                hiddenContent.css({
40                    display: 'block',
41                    height: 'auto',
42                    visibility: 'hidden'
43                });
44
45                var contentHeight = hiddenContent[0].scrollHeight;
46
47                hiddenContent.css({
48                    display: 'none',
49                    height: 0,
50                    visibility: 'visible'
51                });
52
53                // Open the clicked accordion
54                hiddenContent.addClass('active').css({
55                    display: 'block',
56                    height: 0,
57                    opacity: 0
58                }).animate(
59                    { height: contentHeight, opacity: 1 },
60                    {
61                        duration: 300,
62                        complete: function() {
63                            $(this).css('height', ''); // Remove height style to allow for responsive adjustments
64                        }
65                    }
66                );
67
68                icon.addClass('active');
69                accordionItem.addClass('active');
70            }
71        });
72    });
73});

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.