PageSourceSearch

https://glaciermedia.ca/wp-content/plugins/diviflash/public/js/imageAccordion.js?ver=5.4.0

js glaciermedia.ca collected 2026-10-02 07:51:33 UTC 6,734 bytes, 165 lines download raw bytes

1(function ($) {
2    function getResponsiveItemOrder(active_item, active_item_tablet, active_item_phone) {
3        let active_item_order;
4        if (window.matchMedia("(max-width: 768px)").matches) {
5            if (typeof active_item_phone !== "undefined") {
6                active_item_order = ':eq(' + (active_item_phone - 1) + ')';
7            } else if (typeof active_item_tablet !== "undefined") {
8                active_item_order = ':eq(' + (active_item_tablet - 1) + ')';
9            } else if (typeof active_item !== "undefined") {
10                active_item_order = ':eq(' + (active_item - 1) + ')';
11            } else {
12                active_item_order = ':eq(0)';
13            }
14        } else if (window.matchMedia("(max-width: 1024px)").matches) {
15            if (typeof active_item_tablet !== "undefined") {
16                active_item_order = ':eq(' + (active_item_tablet - 1) + ')';
17            } else if (typeof active_item !== "undefined") {
18                active_item_order = ':eq(' + (active_item - 1) + ')';
19            } else {
20                active_item_order = ':eq(0)';
21            }
22        } else {
23            if (typeof active_item !== "undefined") {
24                active_item_order = ':eq(' + (active_item - 1) + ')';
25            } else {
26                active_item_order = ':eq(0)';
27            }
28        }
29
30        return active_item_order;
31    }
32    function df_image_carousel_init(){
33        var df_image_accordion = document.querySelectorAll('.difl_imageaccordion');
34    [].forEach.call(df_image_accordion, function (ele, index) {
35        var container = ele.querySelector('.df_ia_container');
36
37        var settings = JSON.parse(container.dataset.settings);
38
39        var animation_settings = JSON.parse(container.dataset.animation); //_this.find('.df_ia_container').data().animation;
40        var ele_class = ele.classList.value.split(" ").filter(function(class_name){
41            return class_name.indexOf('difl_imageaccordion_') !== -1;
42            });
43        var itemSelector = '.'+ ele_class[0]+ ' .difl_imageaccordionitem';
44        callEventFunction(itemSelector, settings, animation_settings);
45        if (settings.active_item !== '') {
46            const active_item_order = getResponsiveItemOrder(settings.active_item,settings.active_item_tablet,settings.active_item_phone)
47            $(itemSelector).removeClass("df_ia_active");
48            $(itemSelector + active_item_order).addClass("df_ia_active");
49            $(itemSelector + active_item_order).find('.content').css('opacity', 1);
50        }
51        if (settings.outer_click_close_item === 'on') {
52            $(document).on('click', function (e) {
53                var container = $(itemSelector).parent();
54                if (!$(e.target).closest(container).length) {
55                    $(itemSelector).removeClass("df_ia_active");
56                    df_content_visibility(itemSelector, 0, 'hidden');
57                }
58            });
59        }
60    });
61    }
62    df_image_carousel_init();
63
64// Add event listener to detect screen size changes
65    window.addEventListener("resize", df_image_carousel_init);
66    function df_accordion_anime(selector, animation_settings) {
67        var object = {
68            targets: selector,
69            easing: animation_settings.animation_function,
70            duration: parseInt(animation_settings.duration),
71            endDelay: 1,
72            delay: parseInt(animation_settings.delay),
73            begin: function (anim) {
74                if (document.querySelector(selector))
75                    document.querySelector(selector).style.visibility = 'visible';
76            },
77        };
78
79        if (animation_settings.enable_stagger === 'on') {
80            object.delay = anime.stagger(parseInt(animation_settings.stagger));
81        }
82
83        var anime_config = Object.assign(object, animations[animation_settings.content_animation]);
84
85        if (window.anime) {
86            window.anime(anime_config);
87        }
88    }
89
90    function callEventFunction(itemSelector, settings, animation_settings) {
91        jQuery(itemSelector + ':not(".df_ia_active")').on(settings.event_type, function (event) {
92            if (!$(event.target).closest('.df_ia_button').length) {
93                event.stopPropagation();
94                event.preventDefault();
95                if (!$(this).hasClass("df_ia_active")) {
96                    jQuery(itemSelector).removeClass('df_ia_active');
97                    df_content_visibility(itemSelector, 0, 'hidden');
98                    jQuery(this).addClass('df_ia_active');
99    
100                    if (animation_settings.enable_animation === 'on') {
101                        if (animation_settings.enable_stagger === 'on') {
102                            jQuery(this).addClass('df_ia_active');
103                            df_content_visibility(this, 1, 'visible');
104                        }
105    
106                        var anime_selector = animation_settings.enable_stagger === 'on' ?
107                            //`${itemSelector}.df_ia_active .content .anime_wrap` : `${itemSelector}.df_ia_active .content`;
108                            itemSelector + '.df_ia_active .content .anime_wrap' : itemSelector + '.df_ia_active .content';
109                        df_accordion_anime(
110                            anime_selector,
111                            animation_settings
112                        );
113                    } else {
114                        df_content_visibility(this, 1, 'visible');
115                    }
116    
117                }
118            }
119        })
120
121    }
122
123    function df_content_visibility(selector, opacity, visibility) {
124        jQuery(selector).find('.content').css('opacity', opacity);
125        jQuery(selector).find('.content').css('visibility', visibility);
126    }
127
128    var animations = {
129        slide_right: {
130            opacity: ['0', '1'],
131            translateX: ['-100px', '0']
132        },
133        slide_left: {
134            opacity: ['0', '1'],
135            translateX: ['100px', '0']
136        },
137        slide_down: {
138            opacity: ['0', '1'],
139            translateY: ['-100px', '0']
140        },
141        slide_up: {
142            opacity: ['0', '1'],
143            translateY: ['100px', '0']
144        },
145        fade_in: {
146            opacity: ['0', '1'],
147        },
148        zoom_right: {
149            opacity: ['0', '1'],
150            scale: ['.5', '1'],
151            transformOrigin: ['0% 50%', '0% 50%'],
152        },
153        zoom_center: {
154            opacity: ['0', '1'],
155            scale: ['.5', '1'],
156            transformOrigin: ['50% 50%', '50% 50%'],
157        },
158        zoom_left: {
159            opacity: ['0', '1'],
160            scale: ['.5', '1'],
161            transformOrigin: ['100% 50%', '100% 50%'],
162        }
163    }
164
165})(jQuery)

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.