PageSourceSearch

https://www.greenconsulting.it/wp-content/plugins/th-widget-pack/js/themo-foot.js?ver=1.5.10

js greenconsulting.it collected 2026-09-25 01:33:59 UTC 10,882 bytes, 334 lines download raw bytes

1"use strict";
2
3//-----------------------------------------------------
4// Initiate Slider (flexslider)
5//-----------------------------------------------------
6function themo_start_flex_slider(flex_selector,themo_autoplay,themo_flex_animation, themo_flex_easing,
7                                 themo_flex_animationloop, themo_flex_smoothheight, themo_flex_slideshowspeed, themo_flex_animationspeed,
8                                 themo_flex_randomize, themo_flex_pauseonhover, themo_flex_touch, themo_flex_directionnav,themo_flex_controlNav){
9    // SETUP FLEXSLIDER OPTIONS
10    // Remove ajax_loader.gif from Formidable Plugin
11    jQuery("img.frm_ajax_loading").remove();
12    jQuery(flex_selector).flexslider({
13        slideshow: themo_autoplay,
14        animation: themo_flex_animation,
15        smoothHeight: themo_flex_smoothheight,
16        easing: themo_flex_easing,
17        animationLoop: themo_flex_animationloop,
18        slideshowSpeed: themo_flex_slideshowspeed,
19        animationSpeed: themo_flex_animationspeed,
20        randomize: themo_flex_randomize,
21        pauseOnHover: themo_flex_pauseonhover,
22        touch: themo_flex_touch,
23        directionNav: themo_flex_directionnav,
24        controlNav: themo_flex_controlNav,
25        //directionNav: false,
26        prevText: '',
27        nextText: '',
28        start: function (slider) {
29            //slider.removeClass( "flexpreloader");
30            jQuery('body').addClass('loaded');
31        },
32        after: function (slider) {
33        },
34        before: function () {
35        }
36    });
37}
38
39//-----------------------------------------------------
40// Active Lightbox
41//-----------------------------------------------------
42function themo_active_lightbox(){
43    // delegate calls to data-toggle="lightbox"
44    jQuery(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
45        event.preventDefault();
46        return jQuery(this).ekkoLightbox({
47            always_show_close: true,
48            gallery_parent_selector: '.gallery',
49            right_arrow_class: '.flex-next',
50            left_arrow_class: '.flex-prev'
51        });
52    });
53}
54
55
56jQuery( function ( $ ) {
57
58    // fix pricing columns
59	themo_adjust_pricing_table_height();
60
61    // start isotope
62    themo_init_isotope();
63
64    // Add class to section if parallax enabled and we detect an IOS or Andriod device .
65    if (navigator.userAgent.match(/(iPod|iPhone|iPad)/) || (navigator.userAgent.match(/(Android)/))) {
66        //console.log('IOS or Android');
67        $(".th-parallax").addClass( "th-mobile" );
68    }
69
70
71
72
73
74
75    //-----------------------------------------------------
76    // Start isotope / for masonry blog and tours filtering
77    //-----------------------------------------------------
78
79    function themo_init_isotope() {
80
81        // Equalize Heights
82        $.fn.equalizeHeights = function() {
83
84            // construct an array that contains the height of every <div> element
85            var two = $(this).map(function(i, e) {
86                return $(e).height();
87            });
88
89
90
91            return this.height(    // set the height of element <div> element to...
92                Math.max.apply(    // the largest value in...
93                    this,two.get() // the array of height values
94                )
95            ); // ...and finally, return the original jQuery object to enable chaining
96        };
97
98
99
100        // Room Grid / Portfolio
101        var $container = $('.th-portfolio-row').not('.elementor-element-edit-mode .th-portfolio-row');
102
103        // init
104        var $port_grid = $container.isotope({
105        // options
106            itemSelector: '.th-portfolio-item',
107            layoutMode: 'fitRows'
108        });
109
110        // layout Isotope after each image loads
111        $port_grid.imagesLoaded().progress( function() {
112            $port_grid.isotope('layout');
113        });
114
115
116        var $th_cardbody = $('.th-portfolio-row .th-port-card-body');
117
118        // Equalize Card Body
119        $($th_cardbody).equalizeHeights();
120
121
122        // filter items on click handler
123        $('.th-portfolio-filters').on( 'click', 'a', function(e) {
124
125            e.preventDefault();
126
127            // Get Data-filter value
128            var filterValue = $(this).attr('data-filter');
129
130            // Get Parent Class
131            if (filterValue == '*') {
132                var parent_class = $(this).closest('.th-portfolio').attr("id");
133            } else {
134                var parent_class = $(filterValue).closest('.th-portfolio').attr("id");
135            }
136
137            // Remove .current class from all a links inside .th-portfolio-filters
138            $('#'+parent_class+' .th-portfolio-filters a').removeClass( "current" );
139
140            // Add .current class to current filter link.
141            $(this).addClass( "current" );
142
143            // Get the container element to initialize isotope.
144           var $thiscontainer = $('#'+parent_class+' .th-portfolio-row');
145
146            $thiscontainer.isotope({ filter: filterValue });
147
148        });
149
150        // Masonry Blog
151
152        var $bloggrid = $('.mas-blog').isotope({
153            itemSelector: '.mas-blog-post',
154            transitionDuration: '0.2s',
155            percentPosition: true,
156            originLeft: true,
157            masonry: {
158                columnWidth: '.mas-blog-post-sizer'
159                //gutter: 30
160
161            }
162        });
163
164
165
166
167        // layout Isotope after each image loads
168        $bloggrid.imagesLoaded().progress( function() {
169
170            $bloggrid.isotope('layout');
171            $bloggrid.on('layoutComplete', function (event, laidOutItems) {
172                //console.log('layoutComplete with ' + laidOutItems.length + ' items');
173            });
174        });
175
176
177
178
179    }
180
181    //-----------------------------------------------------
182	// Adjust Pricing Table Height
183	//-----------------------------------------------------
184
185    function themo_adjust_pricing_table_height(){
186
187        var $tallestCol;
188
189
190
191        // For each pricing-table element
192        $('.th-pricing-table').each(function(){
193            $tallestCol = 0;
194
195            // Find the plan name
196            $(this).find('> div .th-pricing-title').each(function(){
197                ($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
198            });
199
200            // Safety net increase pricing tables height couldn't be determined
201            if($tallestCol == 0) $tallestCol = 'auto';
202
203            // set even height
204            $(this).find('> div .th-pricing-title').css('height',$tallestCol);
205
206            // Button Wrap
207            $(this).find('> div .th-btn-wrap').each(function(){
208                ($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
209            });
210
211            // Safety net incase pricing tables height couldn't be determined
212            if($tallestCol == 0) $tallestCol = 'auto';
213
214            // Set even height
215            $(this).find('> div .th-btn-wrap').css('height',$tallestCol);
216
217            // FEATURES UL
218            $(this).find('> div .th-pricing-features').each(function(){
219                ($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol;
220            });
221
222            // Safety net incase pricing tables height couldn't be determined
223            if($tallestCol == 0) $tallestCol = 'auto';
224
225            // Set even height
226            $(this).find('> div .th-pricing-features').css('height',$tallestCol);
227
228
229            // END FEATURES UL
230
231        });
232    }
233
234    // Intinerary Toggles
235
236	$( '.th-itinerary' ).find( '.th-itin-single' ).each( function() {
237		var $$ = $( this ),
238			$title = $$.find( '.th-itin-title' ),
239			$content = $$.find( '.th-itin-content' );
240
241
242		$title.on( 'click', function() {
243			if ( $$.hasClass( 'th-itin-active' ) ) {
244                $content.slideUp('fast', function() {
245                    $$.addClass( 'th-itin-inactive' );
246                    $$.removeClass( 'th-itin-active' );
247                });
248			} else {
249                $content.slideDown('fast', function() {
250                    $$.addClass( 'th-itin-active' );
251                    $$.removeClass( 'th-itin-inactive' );
252                });
253			}
254		} );
255
256	} );
257
258
259
260    // tooltips
261    $('a[rel=tooltip]').tooltip();
262
263    // popovers
264    $("a[rel=popover]").popover();
265
266} );
267
268
269
270//======================================================================
271// On Window Load - executes when complete page is fully loaded, including all frames, objects and images
272//======================================================================
273jQuery(window).load(function($) {
274    "use strict";
275
276    // Initiate Lightbox
277    themo_active_lightbox();
278
279});
280
281
282jQuery(window).on('elementor/frontend/init', function () {
283    elementorFrontend.hooks.addAction( 'frontend/element_ready/image-carousel.default', function( $scope ) {
284
285        //var $carousel_wrapper = $scope.find( '.elementor-image-carousel-wrapper' );
286
287        //$carousel_wrapper.parents("div.elementor-widget-image-carousel").css("border",'red solid 5px');
288
289        //var $slick_div = $carousel_wrapper.parents("div.elementor-widget-image-carousel");
290
291
292        //$carousel_wrapper.parents("div.elementor-widget-image-carousel").data( "settingsNEW", "HELLO" );
293
294        //if ( $scope.find( '.elementor-image-carousel-wrapper' ) ){
295
296        //}
297
298        //$scope.find("[data-element_type='image-carousel.default']").data( "settingsNEW", { slides_to_show: "10"}) ;
299
300        //var $image_carousel_div = $scope.find( "elementor-widget-image-carousel" );
301        // console.log($image_carousel_div.id);
302
303        //if ( $scope.find( ".elementor-widget-image-carousel" ) ){
304        //console.log('FOUND IT');
305        //console.log($scope.find( ".elementor-widget-image-carousel" ));
306        //$scope.find( ".elementor-widget-image-carousel" ).data( "settingsNEW", { slides_to_show: "10"} );
307        //}
308
309        //console.log('HELLO');
310    } );
311})
312
313//-----------------------------------------------------
314// Initialize Image Carousel Timeline Slick Slider
315//-----------------------------------------------------
316
317jQuery(document).ready(function ($) {
318
319    if (typeof jQuery.fn.slick === 'function' ) {
320        $('.th-image-carousel-timeline .elementor-image-carousel').slick();
321    }
322
323    // Reinitialize slick when "image carousel timeline" element changes.
324    if (typeof elementorFrontend !== 'undefined' && typeof elementorFrontend.hooks !== 'undefined') {
325        elementorFrontend.hooks.addAction('frontend/element_ready/themo-image-carousel-timeline.default', function ($scope) {
326            var $carousel = $scope.find('.elementor-image-carousel');
327            // Check if slick is not already initialized on the same element.
328            if (typeof jQuery.fn.slick === 'function' && ! $carousel.hasClass('slick-initialized')) {
329                $carousel.slick();
330            }
331        });
332    }
333
334});

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.