PageSourceSearch

https://www.asaintlaurent.com/wp-content/plugins/npo-sites-shortcodes/js/custom-scripts.js?ver=1.14

js asaintlaurent.com collected 2026-10-02 19:12:38 UTC 25,154 bytes, 705 lines download raw bytes

1(function ($) {$(document).ready(function() {
2     "use strict";
3
4// Do not delete above line
5
6    /* Steps List Style ------------------------- */
7
8    $(".steps ol li:first").addClass("first");
9    $(".steps ol li:last").addClass("last");
10
11    $(".steps_with_circle ol").each (function () {
12        $("li", this).each (function (i) {
13            $(this).prepend("<span>" + (i+1) + "</span>" );
14        });
15    });
16
17    /* Image Slider ------------------------- */
18
19    $(".swmsc_image_slider").each(function(){
20
21    	var $this				= $(this),
22    		slideAnimation		= $this.attr("data-slideAnimation") || 'fade',
23    		autoslideOn			= $this.attr("data-autoSlide") || 0,
24    		autoslideInterval	= $this.attr("data-autoSlideInterval") || 7000,
25    		bulletNav			= $this.attr("data-bulletNavigation") || true,
26    		arrowNav			= $this.attr("data-arrowNavigation") || true;
27
28    	if(autoslideOn === "true") { autoslideOn = true; } else { autoslideOn = false; }
29    	if(bulletNav === "true") { bulletNav = true; } else { bulletNav = false; }
30    	if(arrowNav === "true") { arrowNav = true; } else { arrowNav = false; }
31
32    	$this.imagesLoaded( function() {
33    		$this.flexslider({
34    		animation: slideAnimation,
35    		slideshow: autoslideOn,
36    		controlNav: bulletNav,
37    		directionNav : arrowNav,
38    		slideshowSpeed: autoslideInterval,
39    		smoothHeight: true,
40    		useCSS: false,
41    		prevText: '<i class="fa fa-chevron-left"></i>',
42            nextText: '<i class="fa fa-chevron-right"></i>',
43    		start: function(){
44    			$('body').removeClass('loading');
45    		}
46    		});
47    	});
48
49    });
50
51    /* Toggles ------------------------- */
52
53    $(".swmsc_toggle_accordion_container").each( function () {
54    	if($(this).attr('data-id') === 'closed') {
55    		$(this).accordion({ header: '.swmsc_toggle_box_title_accordion', collapsible: true, active: false, heightStyle: 'content', autoHeight: false  });
56    	} else {
57    		$(this).accordion({ header: '.swmsc_toggle_box_title_accordion', collapsible: true, heightStyle: 'content', autoHeight: false });
58    	}
59    });
60
61    $(".swmsc_toggle_box").each( function () {
62    	if($(this).attr('data-id') === 'closed') {
63    		$(this).accordion({ header: '.swmsc_toggle_box_title', collapsible: true, active: false, heightStyle: 'content'  });
64    	} else {
65    		$(this).accordion({ header: '.swmsc_toggle_box_title', collapsible: true, heightStyle: 'content'});
66    	}
67    });
68
69    /* Tabs ------------------------- */
70
71    $('.swmsc_tabs').tabslet({
72        mouseevent: 'click',
73        attribute: 'href',
74        animation: true
75    });
76
77    /* Hide Info Boxes ------------------------- */
78
79    function hide_boxes(){
80    	$('span.swmsc_hide_boxes,span.swmsc_hide_boxes2').click(function() {
81    		$(this).parent().fadeOut();
82    	});
83    }
84
85    /* Custom Gallery ------------------------- */
86
87    function swmsc_image_gallery() {
88         $(".swmsc_image_gallery").each(function() {
89            var $this       = $(this),
90                dataGrid    = $this.attr("data-grid") || 'masonry';
91
92            $this.imagesLoaded( function() {
93                $this.isotope({
94                    itemSelector: '.swmsc_image_gallery_item',
95                    layoutMode: dataGrid,
96                    masonry: {
97                        //custom addition
98                    }
99                });
100
101            });
102        });
103    }
104
105    /* Masonry Fit Raws Items ------------------------- */
106
107    function swmsc_masonry_fitrow() {
108        $(".swmsc_masonry_fitrow").imagesLoaded( function() {
109            $('.swmsc_masonry_fitrow').isotope({
110            itemSelector: '.swmsc_masonry_fitrow_item',
111            layoutMode: 'fitRows',
112            masonry: {
113                //custom addition
114            }
115            });
116        });
117
118    }
119
120    function swmsc_UniversalGridIsotope() {
121
122        $('.swmsc_universal_grid_sort').imagesLoaded( function() {
123            $('.swmsc_universal_grid_sort').isotope({
124                itemSelector: '.swmsc_universal_grid'
125            });
126        });
127    }
128
129    /* Testimonials ------------------------- */
130
131    // testimonials slider shortcode
132
133    function swmsc_testimonialsBoxSlider() {
134
135         $(".swmsc_testimonials_box_slider").each(function() {
136            var $this       = $(this),
137                arrowNav    = $this.attr("data-navArrow") || true,
138                autoPlay    = $this.attr("data-autoplay") || true,
139                playInterval = parseInt($this.attr("data-autoPlayTimeOut") || 5000);
140
141            if (arrowNav === "true") { arrowNav = true; } else { arrowNav = false; }
142            if (autoPlay === "true") { autoPlay = true; } else { autoPlay = false; }
143
144            if ($this.children().length > 1) {
145                $this.imagesLoaded( function() {
146                    $this.owlCarousel({
147                        items:1,
148                        loop:true,
149                        margin:0,
150                        autoplay:autoPlay,
151                        autoplayTimeout:playInterval,
152                        autoplayHoverPause:true,
153                        nav:arrowNav,
154                        navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
155                        autoHeight:true,
156                        smartSpeed:500
157                    });
158                });
159            }
160
161        });
162
163    }
164
165    function swmsc_testimonialsWideSlider() {
166
167        $(".swmsc_testimonials_wide_slider").each(function() {
168            var $this       = $(this),
169                arrowNav    = $this.attr("data-navArrow") || true,
170                autoPlay    = $this.attr("data-autoplay") || true,
171                navDots    = $this.attr("data-navDots") || false,
172                playInterval = parseInt($this.attr("data-autoPlayTimeOut") || 5000);
173
174            if (arrowNav === "true") { arrowNav = true; } else { arrowNav = false; }
175            if (autoPlay === "true") { autoPlay = true; } else { autoPlay = false; }
176            if (navDots === "true") { navDots = true; } else { navDots = false; }
177
178            if ($this.children().length > 1) {
179                $this.imagesLoaded( function() {
180                    $this.owlCarousel({
181                        items:1,
182                        loop:true,
183                        margin:0,
184                        autoplay:autoPlay,
185                        autoplayTimeout:playInterval,
186                        autoplayHoverPause:true,
187                        nav:arrowNav,
188                        navText:['<span class="swmsc_tws_quote_icon"><i class="fa fa-quote-left"></i></span><span class="swmsc_tws_arrow_icon"><i class="fa fa-angle-left"></i></span>','<span class="swmsc_tws_quote_icon"><i class="fa fa-quote-right"></i></span><span class="swmsc_tws_arrow_icon"><i class="fa fa-angle-right"></i></span>'],
189                        autoHeight:true,
190                        animateOut: 'fadeOut',
191                        animateIn: 'fadeIn',
192                        smartSpeed:450,
193                        dots:navDots,
194                        dotsEach:true
195                    });
196                });
197            }
198
199        });
200    }
201
202    function swmsc_logoSlider() {
203
204        $(".swmsc_logo_slider").each(function() {
205            var $this       = $(this),
206                arrowNav   = $this.attr("data-nav") || false,
207                autoPlay    = $this.attr("data-autoplay") || true,
208                rightMargin = parseInt($this.attr("data-margin") || 0),
209                playInterval = parseInt($this.attr("data-autoPlayTimeOut") || 5000),
210                desktopItems = parseInt($this.attr("data-desktop") || 5),
211                tabletItems = parseInt($this.attr("data-tablet") || 4),
212                mobileHorizontalItems = parseInt($this.attr("data-mobileHorizontal") || 2),
213                mobileVerticalItems = parseInt($this.attr("data-mobileVertical") || 1);
214
215            if (arrowNav === "true") { arrowNav = true; } else { arrowNav = false; }
216            if (autoPlay === "true") { autoPlay = true; } else { autoPlay = false; }
217
218            if ($this.children().length > 1) {
219                $this.imagesLoaded( function() {
220                    $this.owlCarousel({
221                        loop:true,
222                        autoplay:autoPlay,
223                        autoplayTimeout:playInterval,
224                        autoplayHoverPause:true,
225                        margin:rightMargin,
226                        responsiveClass:true,
227                        nav:arrowNav,
228                        navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
229                        responsive:{
230                            0:{ items:mobileVerticalItems },
231                            321:{ items:mobileHorizontalItems },
232                            481:{ items:mobileHorizontalItems },
233                            768:{ items:tabletItems },
234                            980:{ items:desktopItems }
235                        }
236                    });
237                });
238            }
239
240       });
241
242    }
243
244    /* Element Horizontal and Verticel Center ------------------------- */
245
246    function swmsc_js_H_Center() {
247
248        $(".swmsc_js_center").each(function(){
249
250            var $this = $(this),
251            elementWidth = $this.width(),
252            elementMargin = elementWidth/-2;
253
254            $this.css('margin-left',elementMargin);
255
256        });
257
258    }
259
260    function swmsc_js_V_Center() {
261
262        $(".swmsc_js_center_top").each(function(){
263
264            var $this = $(this),
265            elementWidth = $this.height(),
266            elementMargin = elementWidth/-2;
267
268            $this.css('margin-top',elementMargin);
269
270        });
271
272    }
273
274    /* Tabs Widget ------------------------- */
275
276    function swmsc_tabs_widget() {
277        $('.swmsc_widget_tabs').each(function() {
278        $(this).find(".swmsc_wid_tab_content").hide();
279            if(document.location.hash && $(this).find("ul.swmsc_wid_tabs li a[href='"+document.location.hash+"']").length >= 1) {
280                $(this).find("ul.swmsc_wid_tabs li a[href='"+document.location.hash+"']").parent().addClass("active").show();
281                $(this).find(document.location.hash+".swmsc_wid_tab_content").show();
282            } else {
283                $(this).find("ul.swmsc_wid_tabs li:first").addClass("active").show();
284                $(this).find(".swmsc_wid_tab_content:first").show();
285            }
286        });
287        $("ul.swmsc_wid_tabs li").click(function(e) {
288            $(this).parents('.swmsc_widget_tabs').find("ul.swmsc_wid_tabs li").removeClass("active");
289            $(this).addClass("active");
290            $(this).parents('.swmsc_widget_tabs').find(".swmsc_wid_tab_content").hide();
291            var activeTab = $(this).find("a").attr("href");
292            $(this).parents('.swmsc_widget_tabs').find(activeTab).fadeIn();
293            e.preventDefault();
294        });
295    }
296
297    /* Media Lightbox ------------------------- */
298
299    function swmsc_magnificPopup() {
300
301        $('.swmsc_popup_img').magnificPopup({
302            type: 'image'
303        });
304
305        $('.swmsc_popup_gallery').magnificPopup({
306            type: 'image',
307            gallery:{
308                enabled:true,
309                tCounter:''
310            },
311            zoom: {
312                enabled: true,
313                duration: 300,
314                easing: 'ease-in-out'
315            }
316        });
317
318        $('.popup-youtube, .popup-vimeo, .popup-gmaps,.swmsc_popup_video').magnificPopup({
319            disableOn: 700,
320            type: 'iframe',
321            mainClass: 'mfp-fade',
322            removalDelay: 160,
323            preloader: false,
324            fixedContentPos: false
325        });
326
327    }
328
329    /* Flickr Widget ------------------------- */
330
331    function swmsc_widget_flickr_photos() {
332
333        $(".sidebar .flickr_photos").each(function(){
334
335            var $this = $(this),
336                swmSidebarFlickrId = $this.attr("data-flickr-id") || '90291761@N02',
337                flickrDisplayPhotos = parseInt($this.attr("data-display-photos") || 6);
338
339            $this.append('<ul id="cbox1" class="thumbs sidebar_flickr_photos ">');
340
341            $('#cbox1').jflickrfeed({
342                limit   : flickrDisplayPhotos,
343                qstrings: {
344                    id: swmSidebarFlickrId  // replace example flickr id with your flickr id
345                },
346                itemTemplate: '<li>'+'<a href="{{link}}" title="{{title}}" >' + '<img src="{{image_q}}" alt="{{title}}" />' + '</a>' + '</li>'
347            }, function(data) {
348
349            });
350
351            $this.append('<div class="clear"></div>');
352
353        });
354
355        $(".footer .flickr_photos").each(function(){
356
357            var $this = $(this),
358                flickrId = $this.attr("data-flickr-id") || '90291761@N02',
359                flickrDisplayPhotos = parseInt($this.attr("data-display-photos") || 6);
360
361            $this.append('<ul id="cbox2" class="thumbs footer_flickr_photos">');
362
363            $('#cbox2').jflickrfeed({
364                limit   : flickrDisplayPhotos,
365                qstrings: {
366                    id: flickrId  // replace example flickr id with your flickr id
367                },
368                itemTemplate: '<li>'+'<a href="{{link}}" title="{{title}}" >' + '<img src="{{image_q}}" alt="{{title}}" />' + '</a>' + '</li>'
369            }, function(data) {
370
371            });
372
373            $this.append('<div class="clear"></div>');
374
375        });
376
377    }
378
379    /* Animated Elements, Counter, Pie Chart with WayPoints ------------------------- */
380
381    function swmsc_waypoint() {
382
383        if (typeof jQuery.fn.waypoint !== 'undefined') {
384
385            var element = $('.swmsc_element_visible'),
386                isMobile = document.documentElement.ontouchstart !== undefined ? true : false;
387
388            /* Element Animations ----------------------------------------- */
389
390            if(isMobile) {
391                element.addClass('swmsc_animation_start');
392            }
393            else {
394                element.waypoint(function(direction) {
395                    $(this).addClass('swmsc_animation_start');
396                }, { offset: '85%' } );
397            }
398
399            /* Stat Counter ----------------------------------------- */
400
401            $('.swmsc_stat_counter').waypoint(function(direction) {
402                $(this).each(function(){
403
404                    var datafinalnumber = $(this).attr('data-finalNumber'),
405                        dataspeed = $(this).attr('data-speed');
406
407                    $(this).find('.swmsc_counter_box_count').delay(5000).countTo({
408                        from: 0,
409                        to: datafinalnumber,
410                        speed: dataspeed,
411                        refreshInterval: 10
412                    });
413
414                });
415            }, {
416            	triggerOnce: true,
417            	offset: '90%'
418            	}
419            );
420
421            /* Pie Chart ----------------------------------------- */
422
423		    $('.swmsc_counter_circle').waypoint(function() {
424		        $(this).each(function() {
425		        	var $element = $(this).children(".swmsc_counter_circle_text");
426		            $(this).children(".swmsc_counter_circle_text").easyPieChart({
427		                barColor: $element.attr('data-trackColor'),
428		                trackColor: $element.attr('data-barColor'),
429		                scaleColor: false,
430		                scaleLength: 5,
431		                lineCap: "round",
432		                lineWidth: $element.attr('data-lineWidth'),
433		                size: $element.attr('data-chartSize'),
434		                rotate: 0,
435		                animate: $element.attr('data-speed'),
436		            });
437		        });
438		    }, {
439		        triggerOnce: true,
440		        offset: '100%'
441		    });
442
443
444            /* Progress Bar ----------------------------------------- */
445
446            $('.swmsc_progress_bar .swmsc_progress_bar_out').waypoint(function(direction) {
447
448                var $element = $(this);
449
450                $element.each(function () {
451                    $element.animate({
452                        width: $(this).attr("data-width") + '%'
453                    }, 2000);
454                });
455
456             }, {
457            	triggerOnce: true,
458            	offset: '90%'
459            	}
460            );
461
462
463        } // if fn.waypoint end
464    }
465
466    /* Logo Grid ----------------------------------------- */
467
468    function swmsc_logo_grids() {
469
470            $(".swmsc_client_logos").each(function() {
471
472                var $this               = $(this),
473                    totalColumn         = parseInt($this.attr("data-column") || 4),
474                    columnWidth         = '25%',
475                    logoItem            = $this.children();
476
477                    if ( totalColumn == 6 ) {
478                        columnWidth = '16.66%';
479                    } else if ( totalColumn == 5 ) {
480                        columnWidth = '20%';
481                    } else if ( totalColumn == 4 ) {
482                        columnWidth = '25%';
483                    } else if ( totalColumn == 3 ) {
484                        columnWidth = '33.33%';
485                    } else if ( totalColumn == 2 ) {
486                        columnWidth = '50%';
487                    } else if ( totalColumn == 1 ) {
488                        columnWidth = '100%';
489                    }
490
491                $this.imagesLoaded( function() {
492                    if ($(window).width() > 978) {
493                        logoItem.css('width',columnWidth);
494                    } else if (($(window).width() < 979) && ($(window).width() > 767))  {
495                        logoItem.css('width','25%');
496                    } else if (($(window).width() < 768) && ($(window).width() > 480))  {
497                        logoItem.css('width','33.33%');
498                     } else if (($(window).width() < 481) && ($(window).width() > 320))  {
499                        logoItem.css('width','50%');
500                    }else if ($(window).width() < 321)  {
501                        logoItem.css('width','100%');
502                    } else {
503                        logoItem.css('width',columnWidth);
504                    }
505                });
506
507            });
508
509    }
510
511    /* Services Style Responsive Grid ----------------------------------------- */
512
513    function swmsc_services_icons() {
514
515        $(".swmsc_responsive_services").each(function() {
516
517            var $this           = $(this),
518                responsiveWidth = parseInt($this.attr("data-responsive") || 800),
519                elementMargin = parseInt($this.attr("data-margin") || 20)+'px';
520
521            if ( $this.hasClass('swmsc_services_item_left') ) {
522                 if ($(window).width() <= responsiveWidth) {
523                    $this.addClass('swmsc_services_responsive');
524                    $this.find('.swmsc_services_item_holder').css('margin-bottom',elementMargin);
525                    $this.find('.swmsc_services_item_holder').css('margin-right','0');
526                } else {
527                    $this.removeClass('swmsc_services_responsive');
528                    $this.find('.swmsc_services_item_holder').css('margin-bottom','0');
529                    $this.find('.swmsc_services_item_holder').css('margin-right',elementMargin);
530                }
531            }
532            if ( $this.hasClass('swmsc_services_item_right') ) {
533                 if ($(window).width() <= responsiveWidth) {
534                    $this.addClass('swmsc_services_responsive');
535                    $this.find('.swmsc_services_item_holder').css('margin-bottom',elementMargin);
536                    $this.find('.swmsc_services_item_holder').css('margin-left','0');
537                } else {
538                    $this.removeClass('swmsc_services_responsive');
539                    $this.find('.swmsc_services_item_holder').css('margin-bottom','0');
540                    $this.find('.swmsc_services_item_holder').css('margin-left',elementMargin);
541                }
542            }
543
544        });
545
546    }
547
548    function swmsc_recentPostsSlider() {
549
550        $(".swmsc_recent_posts_slider_container").each(function() {
551            var $this       = $(this),
552                arrowNav    = $this.attr("data-navArrow") || true,
553                autoPlay    = $this.attr("data-autoplay") || true,
554                playInterval = parseInt($this.attr("data-autoPlayTimeOut") || 5000);
555
556            if (arrowNav === "true") { arrowNav = true; } else { arrowNav = false; }
557            if (autoPlay === "true") { autoPlay = true; } else { autoPlay = false; }
558
559            if ($this.children().length > 1) {
560                $this.imagesLoaded( function() {
561                    $this.owlCarousel({
562                        items:1,
563                        loop:true,
564                        margin:0,
565                        autoplay:autoPlay,
566                        autoplayTimeout:playInterval,
567                        autoplayHoverPause:true,
568                        nav:arrowNav,
569                        navText:['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
570                        autoHeight:true,
571                        animateOut: 'fadeOut',
572                        animateIn: 'fadeIn',
573                        dots:false,
574                        dotsEach:true,
575                        dotData:true
576                    });
577                });
578            }
579
580        });
581    }
582
583    function swmsc_buttonShortcode() {
584
585        $("a.swmsc_button_sc").each(function(){
586
587            var $this               = $(this),
588                btnColor            = $this.attr("data-color") || '#ffffff',
589                btnBgColor          = $this.attr("data-bg-color") || '#444444',
590                btnBorderColor      = $this.attr("data-border-color") || '#444444',
591                btnHoverColor       = $this.attr("data-h-color") || '#ffffff',
592                btnHoverBgColor     = $this.attr("data-h-bg-color") || '#777777',
593                btnHoverBorderColor = $this.attr("data-h-border-color") || '#777777';
594
595                $this.css({
596                    "color": btnColor,
597                    "background-color": btnBgColor,
598                    "border-color": btnBorderColor
599                });
600
601                $this.hover(function(){
602                    $this.css({
603                        "color": btnHoverColor,
604                        "background-color": btnHoverBgColor,
605                        "border-color": btnHoverBorderColor
606                    });
607                    }, function(){
608                        $this.css({
609                            "color": btnColor,
610                            "background-color": btnBgColor,
611                            "border-color": btnBorderColor
612                        });
613                });
614
615        });
616
617    }
618
619    function swmsc_causeButtonShortcode() {
620
621        $("a.swmsc_cause_sc_button").each(function(){
622
623            var $this               = $(this),
624                btnColor            = $this.attr("data-color") || '#ffffff',
625                btnBgColor          = $this.attr("data-bg-color") || '#666666',
626                btnBgHoverColor     = $this.attr("data-h-bg-color") || '#222222';
627
628                $this.css({
629                    "color": btnColor,
630                    "background-color": btnBgColor
631                });
632
633                $this.hover(function(){
634                    $this.css({
635                        "color": btnColor,
636                        "background-color": btnBgHoverColor
637                    });
638                    }, function(){
639                        $this.css({
640                            "color": btnColor,
641                            "background-color": btnBgColor
642                        });
643                });
644
645        });
646
647    }
648
649    function swmsc_causeAllLinks() {
650
651        $("a.onHoverLinkSelector").each(function(){
652
653            var $this           = $(this),
654                linkColor       = $this.attr("data-color") || '',
655                linkHoverColor  = $this.attr("data-h-color") || '';
656
657                $this.css({
658                    "color": linkColor
659                });
660
661                $this.hover(function(){
662                    $this.css({
663                        "color": linkHoverColor
664                    });
665                    }, function(){
666                        $this.css({
667                            "color": linkColor
668                        });
669                });
670
671        });
672
673    }
674
675
676    /* All functions ----------------------------------------- */
677
678    hide_boxes();
679    swmsc_image_gallery();
680    swmsc_masonry_fitrow();
681    swmsc_UniversalGridIsotope();
682    swmsc_testimonialsBoxSlider();
683    swmsc_testimonialsWideSlider();
684    swmsc_logoSlider();
685    swmsc_js_H_Center();
686    swmsc_js_V_Center();
687    swmsc_tabs_widget();
688    swmsc_magnificPopup();
689    swmsc_widget_flickr_photos();
690    swmsc_waypoint();
691    swmsc_logo_grids();
692    swmsc_services_icons();
693    swmsc_recentPostsSlider();
694    swmsc_buttonShortcode();
695    swmsc_causeButtonShortcode();
696    swmsc_causeAllLinks();
697
698    $(window).resize(function () {
699        swmsc_logo_grids();
700        swmsc_services_icons();
701    });
702
703/****************************************************************/
704}); })(jQuery);
705// Do not delete above lines

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.