PageSourceSearch

https://www.lexarhomes.com/wp-content/themes/homeo/js/functions.js?ver=20150330

js lexarhomes.com collected 2026-09-29 15:29:22 UTC 22,862 bytes, 1,140 lines download raw bytes

1(function ($) {
2
3    "use strict";
4
5
6
7    if (!$.apusThemeExtensions)
8
9        $.apusThemeExtensions = {};
10
11    
12
13    function ApusThemeCore() {
14
15        var self = this;
16
17        // self.init();
18
19    };
20
21
22
23    ApusThemeCore.prototype = {
24
25        /**
26
27         *  Initialize
28
29         */
30
31        init: function() {
32
33            var self = this;
34
35            
36
37            self.preloadSite();
38
39
40
41            self.activeAccordion();
42
43
44
45            // slick init
46
47            self.initSlick($("[data-carousel=slick]"));
48
49
50
51            // isoto
52
53            self.initIsotope();
54
55
56
57            // Unveil init
58
59            setTimeout(function(){
60
61                self.layzyLoadImage();
62
63            }, 200);
64
65
66
67            self.initHeaderSticky('main-sticky-header');
68
69
70
71            // self.initHeaderSticky('header-mobile');
72
73
74
75            // back to top
76
77            self.backToTop();
78
79
80
81            // popup image
82
83            self.popupImage();
84
85
86
87            $('[data-toggle="tooltip"]').tooltip();
88
89
90
91            self.initMobileMenu();
92
93
94
95            self.mainMenuInit();
96
97            
98
99            $(document.body).on('click', '.nav [data-toggle="dropdown"]', function(e){
100
101                e.preventDefault();
102
103                if ( this.href && this.href != '#' ){
104
105                    if ( this.target && this.target == '_blank' ) {
106
107                        window.open(this.href, '_blank');
108
109                    } else {
110
111                        window.location.href = this.href;
112
113                    }
114
115                }
116
117            });
118
119
120
121            self.loadExtension();
122
123        },
124
125        /**
126
127         *  Extensions: Load scripts
128
129         */
130
131        loadExtension: function() {
132
133            var self = this;
134
135            
136
137            if ($.apusThemeExtensions.quantity_increment) {
138
139                $.apusThemeExtensions.quantity_increment.call(self);
140
141            }
142
143
144
145            if ($.apusThemeExtensions.shop) {
146
147                $.apusThemeExtensions.shop.call(self);
148
149            }
150
151
152
153            if ($.apusThemeExtensions.property_map) {
154
155                $.apusThemeExtensions.property_map.call(self);
156
157            }
158
159
160
161            if ($.apusThemeExtensions.property) {
162
163                $.apusThemeExtensions.property.call(self);
164
165            }
166
167        },
168
169        initSlick: function(element) {
170
171            var self = this;
172
173            element.each( function(){
174
175                var config = {
176
177                    infinite: false,
178
179                    arrows: $(this).data( 'nav' ),
180
181                    dots: $(this).data( 'pagination' ),
182
183                    slidesToShow: 4,
184
185                    slidesToScroll: 4,
186
187                    prevArrow:"<button type='button' class='slick-arrow slick-prev'><i class='flaticon-left-arrow-1' aria-hidden='true'></i></span><span class='textnav'>"+ homeo_ajax.previous +"</span></button>",
188
189                    nextArrow:"<button type='button' class='slick-arrow slick-next'><span class='textnav'>"+ homeo_ajax.next +"</span><i class='flaticon-right-arrow' aria-hidden='true'></i></button>",
190
191                };
192
193            
194
195                var slick = $(this);
196
197                if( $(this).data('items') ){
198
199                    config.slidesToShow = $(this).data( 'items' );
200
201                    var slidestoscroll = $(this).data( 'items' );
202
203                }
204
205                if( $(this).data('infinite') ){
206
207                    config.infinite = true;
208
209                }
210
211                if( $(this).data('autoplay') ){
212
213                    config.autoplay = true;
214
215                    config.autoplaySpeed = 2500;
216
217                    config.pauseOnHover = true;
218
219                }
220
221                if( $(this).data('disable_draggable') ){
222
223                    config.touchMove = false;
224
225                    config.draggable = false;
226
227                    config.swipe = false;
228
229                    config.swipeToSlide = false;
230
231                }
232
233                if( $(this).data('centermode') ){
234
235                    config.centerMode = true;
236
237                }
238
239                if( $(this).data('vertical') ){
240
241                    config.vertical = true;
242
243                }
244
245                if( $(this).data('rows') ){
246
247                    config.rows = $(this).data( 'rows' );
248
249                }
250
251                if( $(this).data('asnavfor') ){
252
253                    config.asNavFor = $(this).data( 'asnavfor' );
254
255                }
256
257                if( $(this).data('slidestoscroll') ){
258
259                    var slidestoscroll = $(this).data( 'slidestoscroll' );
260
261                }
262
263                if( $(this).data('focusonselect') ){
264
265                    config.focusOnSelect = $(this).data( 'focusonselect' );
266
267                }
268
269                config.slidesToScroll = slidestoscroll;
270
271
272
273                if ($(this).data('large')) {
274
275                    var desktop = $(this).data('large');
276
277                } else {
278
279                    var desktop = config.items;
280
281                }
282
283                if ($(this).data('smalldesktop')) {
284
285                    var smalldesktop = $(this).data('smalldesktop');
286
287                } else {
288
289                    if ($(this).data('large')) {
290
291                        var smalldesktop = $(this).data('large');
292
293                    } else{
294
295                        var smalldesktop = config.items;
296
297                    }
298
299                }
300
301                if ($(this).data('medium')) {
302
303                    var medium = $(this).data('medium');
304
305                } else {
306
307                    var medium = config.items;
308
309                }
310
311                if ($(this).data('smallmedium')) {
312
313                    var smallmedium = $(this).data('smallmedium');
314
315                } else {
316
317                    var smallmedium = 2;
318
319                }
320
321                if ($(this).data('extrasmall')) {
322
323                    var extrasmall = $(this).data('extrasmall');
324
325                } else {
326
327                    var extrasmall = 2;
328
329                }
330
331                if ($(this).data('smallest')) {
332
333                    var smallest = $(this).data('smallest');
334
335                } else {
336
337                    var smallest = 1;
338
339                }
340
341
342
343
344
345                if ($(this).data('slidestoscroll_large')) {
346
347                    var slidestoscroll_desktop = $(this).data('slidestoscroll_large');
348
349                } else {
350
351                    var slidestoscroll_desktop = config.slidesToScroll;
352
353                }
354
355                if ($(this).data('slidestoscroll_smalldesktop')) {
356
357                    var slidestoscroll_smalldesktop = $(this).data('slidestoscroll_smalldesktop');
358
359                } else {
360
361                    if ($(this).data('slidestoscroll_large')) {
362
363                        var slidestoscroll_smalldesktop = $(this).data('slidestoscroll_large');
364
365                    } else{
366
367                        var slidestoscroll_smalldesktop = config.items;
368
369                    }
370
371                }
372
373                if ($(this).data('slidestoscroll_medium')) {
374
375                    var slidestoscroll_medium = $(this).data('slidestoscroll_medium');
376
377                } else {
378
379                    var slidestoscroll_medium = config.items;
380
381                }
382
383                if ($(this).data('slidestoscroll_smallmedium')) {
384
385                    var slidestoscroll_smallmedium = $(this).data('slidestoscroll_smallmedium');
386
387                } else {
388
389                    var slidestoscroll_smallmedium = smallmedium;
390
391                }
392
393                if ($(this).data('slidestoscroll_extrasmall')) {
394
395                    var slidestoscroll_extrasmall = $(this).data('slidestoscroll_extrasmall');
396
397                } else {
398
399                    var slidestoscroll_extrasmall = extrasmall;
400
401                }
402
403                if ($(this).data('slidestoscroll_smallest')) {
404
405                    var slidestoscroll_smallest = $(this).data('slidestoscroll_smallest');
406
407                } else {
408
409                    var slidestoscroll_smallest = smallest;
410
411                }
412
413                config.responsive = [
414
415                    {
416
417                        breakpoint: 321,
418
419                        settings: {
420
421                            slidesToShow: smallest,
422
423                            slidesToScroll: slidestoscroll_smallest,
424
425                        }
426
427                    },
428
429                    {
430
431                        breakpoint: 580,
432
433                        settings: {
434
435                            slidesToShow: extrasmall,
436
437                            slidesToScroll: slidestoscroll_extrasmall,
438
439                        }
440
441                    },
442
443                    {
444
445                        breakpoint: 769,
446
447                        settings: {
448
449                            slidesToShow: smallmedium,
450
451                            slidesToScroll: slidestoscroll_smallmedium
452
453                        }
454
455                    },
456
457                    {
458
459                        breakpoint: 981,
460
461                        settings: {
462
463                            slidesToShow: medium,
464
465                            slidesToScroll: slidestoscroll_medium
466
467                        }
468
469                    },
470
471                    {
472
473                        breakpoint: 1200,
474
475                        settings: {
476
477                            slidesToShow: smalldesktop,
478
479                            slidesToScroll: slidestoscroll_smalldesktop
480
481                        }
482
483                    },
484
485                    {
486
487                        breakpoint: 1501,
488
489                        settings: {
490
491                            slidesToShow: desktop,
492
493                            slidesToScroll: slidestoscroll_desktop
494
495                        }
496
497                    }
498
499                ];
500
501
502
503                if ( $('html').attr('dir') == 'rtl' ) {
504
505                    config.rtl = true;
506
507                }
508
509
510
511                $(this).slick( config );
512
513
514
515            } );
516
517
518
519            // Fix owl in bootstrap tabs
520
521            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
522
523                var target = $(e.target).attr("href");
524
525                var $slick = $(".slick-carousel", target);
526
527
528
529                if ($slick.length > 0 && $slick.hasClass('slick-initialized')) {
530
531                    $slick.slick('refresh');
532
533                }
534
535                self.layzyLoadImage();
536
537            });
538
539        },
540
541        layzyLoadImage: function() {
542
543            $(window).off('scroll.unveil resize.unveil lookup.unveil');
544
545            var $images = $('.image-wrapper:not(.image-loaded) .unveil-image'); // Get un-loaded images only
546
547            if ($images.length) {
548
549                $images.unveil(1, function() {
550                    
551                    $(this).on('load', function(){
552                        $(this).parents('.image-wrapper').first().addClass('image-loaded');
553
554                        $(this).removeAttr('data-src');
555
556                        $(this).removeAttr('data-srcset');
557
558                        $(this).removeAttr('data-sizes');
559                    });
560
561                });
562
563            }
564
565
566
567            var $images = $('.product-image:not(.image-loaded) .unveil-image'); // Get un-loaded images only
568
569            if ($images.length) {
570
571                $images.unveil(1, function() {
572
573                    $(this).load(function() {
574
575                        $(this).parents('.product-image').first().addClass('image-loaded');
576
577                    });
578
579                });
580
581            }
582
583        },
584
585        initIsotope: function() {
586
587            $('.isotope-items').each(function(){  
588
589                var $container = $(this);
590
591                
592
593                $container.imagesLoaded( function(){
594
595                    $container.isotope({
596
597                        itemSelector : '.isotope-item',
598
599                        transformsEnabled: true,         // Important for videos
600
601                        masonry: {
602
603                            columnWidth: $container.data('columnwidth')
604
605                        }
606
607                    }); 
608
609                });
610
611            });
612
613
614
615            /*---------------------------------------------- 
616
617             *    Apply Filter        
618
619             *----------------------------------------------*/
620
621            $('.isotope-filter li a').on('click', function(){
622
623               
624
625                var parentul = $(this).parents('ul.isotope-filter').data('related-grid');
626
627                $(this).parents('ul.isotope-filter').find('li a').removeClass('active');
628
629                $(this).addClass('active');
630
631                var selector = $(this).attr('data-filter'); 
632
633                $('#'+parentul).isotope({ filter: selector }, function(){ });
634
635                
636
637                return(false);
638
639            });
640
641        },
642
643        initHeaderSticky: function(main_sticky_class) {
644
645            if ( $('.' + main_sticky_class).length ) {
646
647                if ( typeof Waypoint !== 'undefined' ) {
648
649                    if ( $('.' + main_sticky_class) && typeof Waypoint.Sticky !== 'undefined' ) {
650
651                        var sticky = new Waypoint.Sticky({
652
653                            element: $('.' + main_sticky_class)[0],
654
655                            wrapper: '<div class="main-sticky-header-wrapper">',
656
657                            offset: '-10px',
658
659                            stuckClass: 'sticky-header'
660
661                        });
662
663                    }
664
665                }
666
667            }
668
669        },
670
671        backToTop: function () {
672
673            $(window).scroll(function () {
674
675                if ($(this).scrollTop() > 400) {
676
677                    $('#back-to-top').addClass('active');
678
679                } else {
680
681                    $('#back-to-top').removeClass('active');
682
683                }
684
685            });
686
687            $('#back-to-top').on('click', function () {
688
689                $('html, body').animate({scrollTop: '0px'}, 800);
690
691                return false;
692
693            });
694
695        },
696
697        
698
699        popupImage: function() {
700
701            // popup
702
703            $(".popup-image").magnificPopup({type:'image'});
704
705            $('.popup-video').magnificPopup({
706
707                disableOn: 700,
708
709                type: 'iframe',
710
711                mainClass: 'mfp-fade',
712
713                removalDelay: 160,
714
715                preloader: false,
716
717                fixedContentPos: false
718
719            });
720
721
722
723            $('.widget-gallery').each(function(){
724
725                var tagID = $(this).attr('id');
726
727                $('#' + tagID).magnificPopup({
728
729                    delegate: '.popup-image-gallery',
730
731                    type: 'image',
732
733                    tLoading: 'Loading image #%curr%...',
734
735                    mainClass: 'mfp-img-mobile',
736
737                    gallery: {
738
739                        enabled: true,
740
741                        navigateByImgClick: true,
742
743                        preload: [0,1] // Will preload 0 - before current, and 1 after the current image
744
745                    }
746
747                });
748
749            });
750
751        },
752
753        preloadSite: function() {
754
755            // preload page
756
757            setTimeout(function(){
758
759                if ( $('body').hasClass('apus-body-loading') ) {
760
761                    $('body').removeClass('apus-body-loading');
762
763                    $('.apus-page-loading').fadeOut(100);
764
765                }
766
767            }, 100);
768
769        },
770
771        
772
773        activeAccordion: function() {
774
775            $('.panel-collapse').on('show.bs.collapse', function () {
776
777                $(this).siblings('.panel-heading').addClass('active');
778
779            });
780
781
782
783            $('.panel-collapse').on('hide.bs.collapse', function () {
784
785                $(this).siblings('.panel-heading').removeClass('active');
786
787            });
788
789        },
790
791
792
793        initMobileMenu: function() {
794
795
796
797            // menu
798
799            var mobilemenu = $("#navbar-offcanvas").mmenu({
800
801                offCanvas: true,
802
803                navbar: {
804
805                    title: homeo_ajax.mmenu_title
806
807                }
808
809            }, {
810
811                // configuration
812
813                offCanvas: {
814
815                    pageSelector: "#wrapper-hidden"
816
817                }
818
819            });
820
821
822
823            // sidebar mobile            
824
825            $('body').on('click', '.mobile-sidebar-btn', function(){
826
827                if ( $('.sidebar-left').length > 0 ) {
828
829                    $('.sidebar-left').toggleClass('active');
830
831                } else if ( $('.sidebar-right').length > 0 ) {
832
833                    $('.sidebar-right').toggleClass('active');
834
835                }
836
837                $('.mobile-sidebar-panel-overlay').toggleClass('active');
838
839                $('.mobile-sidebar-btn i').toggleClass('ti-menu-alt ti-close');
840
841            });
842
843            $('body').on('click', '.mobile-sidebar-panel-overlay, .close-sidebar-btn', function(){
844
845                if ( $('.sidebar-left').length > 0 ) {
846
847                    $('.sidebar-left').removeClass('active');
848
849                } else if ( $('.sidebar-right').length > 0 ) {
850
851                    $('.sidebar-right').removeClass('active');
852
853                }
854
855                $('.mobile-sidebar-panel-overlay').removeClass('active');
856
857                $('.mobile-sidebar-btn i').toggleClass('ti-menu-alt ti-close');
858
859            });
860
861
862
863
864
865            if ($(window).width() < 992) {
866
867                if ( $('.sidebar-wrapper:not(.offcanvas-filter-sidebar) > .sidebar-right, .sidebar-wrapper:not(.offcanvas-filter-sidebar) > .sidebar-left').length ) {
868
869                    var ps = new PerfectScrollbar('.sidebar-wrapper:not(.offcanvas-filter-sidebar) > .sidebar-right, .sidebar-wrapper:not(.offcanvas-filter-sidebar) > .sidebar-left', {
870
871                        wheelPropagation: true
872
873                    });
874
875                }
876
877            }
878
879
880
881            $(window).scroll(function () {
882
883                if ($(window).width() <= 600) {
884
885                    if ( $('#wpadminbar').length ) {
886
887                        var admin_bar_h = $('#wpadminbar').outerHeight();
888
889                        var scroll_h = $(this).scrollTop();
890
891                        if (scroll_h > admin_bar_h) {
892
893                            $('.admin-bar .header-mobile').css({'top': 0});
894
895                        } else {
896
897                            var top = admin_bar_h - scroll_h;
898
899                            $('.admin-bar .header-mobile').css({'top': top});
900
901                        }
902
903                    }
904
905                }
906
907            });
908
909        },
910
911        mainMenuInit: function() {
912
913            $('.apus-megamenu .megamenu .has-mega-menu.aligned-fullwidth').each(function(e){
914
915                var $this = $(this),
916
917                    i = $this.closest(".elementor-container"),
918
919                    a = $this.closest('.apus-megamenu');
920
921                $this.on('hover', function(){
922
923                    var m = $(this).find('> .dropdown-menu .dropdown-menu-inner'),
924
925                        w = i.width();
926
927
928
929                    m.css({
930
931                        width: w,
932
933                        marginLeft: i.offset().left - a.offset().left
934
935                    });
936
937                });
938
939
940
941                $this.find('.elementor-element').addClass('no-trans
941parent');
942
943            });
944
945        },
946
947
948
949        setCookie: function(cname, cvalue, exdays) {
950
951            var d = new Date();
952
953            d.setTime(d.getTime() + (exdays*24*60*60*1000));
954
955            var expires = "expires="+d.toUTCString();
956
957            document.cookie = cname + "=" + cvalue + "; " + expires+";path=/";
958
959        },
960
961        getCookie: function(cname) {
962
963            var name = cname + "=";
964
965            var ca = document.cookie.split(';');
966
967            for(var i=0; i<ca.length; i++) {
968
969                var c = ca[i];
970
971                while (c.charAt(0)==' ') c = c.substring(1);
972
973                if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
974
975            }
976
977            return "";
978
979        }
980
981    }
982
983
984
985    $.apusThemeCore = ApusThemeCore.prototype;
986
987
988
989    $(document).ready(function() {
990
991        // Initialize script
992
993        var apusthemecore_init = new ApusThemeCore();
994
995        apusthemecore_init.init();
996
997    });
998
999
1000
1001    jQuery(window).on("elementor/frontend/init", function() {
1002
1003        
1004
1005        var apusthemecore_init = new ApusThemeCore();
1006
1007
1008
1009        // General element
1010
1011        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_brands.default",
1012
1013            function($scope) {
1014
1015                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1016
1017            }
1018
1019        );
1020
1021
1022
1023        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_features_box.default",
1024
1025            function($scope) {
1026
1027                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1028
1029            }
1030
1031        );
1032
1033
1034
1035        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_instagram.default",
1036
1037            function($scope) {
1038
1039                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1040
1041            }
1042
1043        );
1044
1045
1046
1047        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_posts.default",
1048
1049            function($scope) {
1050
1051                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1052
1053            }
1054
1055        );
1056
1057
1058
1059        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_testimonials.default",
1060
1061            function($scope) {
1062
1063                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1064
1065            }
1066
1067        );
1068
1069
1070
1071        // real estate elements
1072
1073        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_realestate_agencies.default",
1074
1075            function($scope) {
1076
1077                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1078
1079            }
1080
1081        );
1082
1083
1084
1085        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_realestate_agents.default",
1086
1087            function($scope) {
1088
1089                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1090
1091            }
1092
1093        );
1094
1095
1096
1097        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_realestate_properties.default",
1098
1099            function($scope) {
1100
1101                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1102
1103                apusthemecore_init.layzyLoadImage();
1104
1105            }
1106
1107        );
1108
1109
1110
1111        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_realestate_properties_tabs.default",
1112
1113            function($scope) {
1114
1115                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1116
1117            }
1118
1119        );
1120
1121
1122
1123        elementorFrontend.hooks.addAction( "frontend/element_ready/apus_element_realestate_properties_slider.default",
1124
1125            function($scope) {
1126
1127                apusthemecore_init.initSlick($scope.find('.slick-carousel'));
1128
1129            }
1130
1131        );
1132
1133    });
1134
1135
1136
1137})(jQuery);
1138
1139
1140

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.