PageSourceSearch

https://midnightpharmacy.com/wp-content/themes/midnight-pharmacy/js/custom.js?v=2

js midnightpharmacy.com collected 2026-10-05 23:51:18 UTC 7,004 bytes, 211 lines download raw bytes

1(function($) {
2
3    "use strict";
4    $.fn.bizbir = function() {
5        return this.each(function(i, elem) {
6            var portfolioContainer = jQuery('.portfolio-container', elem);
7            portfolioContainer.imagesLoaded(function() {
8                portfolioContainer.isotope({
9                    filter: '*',
10                    animationOptions: {
11                        duration: 750,
12                        easing: 'linear',
13                        queue: false
14                    }
15                });
16            });
17            jQuery('.portfolio-filter a', elem).on('click', function(e) {
18                e.preventDefault();
19                jQuery('.portfolio-filter .current', elem).removeClass('current');
20                jQuery(this).addClass('current');
21
22                var selector = jQuery(this).attr('data-filter');
23                portfolioContainer.isotope({
24                    filter: selector,
25                    animationOptions: {
26                        duration: 750,
27                        easing: 'linear',
28                        queue: false
29                    }
30                });
31                return false;
32            });
33        });
34    };
35
36    $(document).ready(function($) {
37        
38        $('.datepicker-here').data('datepicker');
39        
40        $('.datepicker-here').datepicker({
41    language: 'en',
42            dateFormat: 'dd/mm/yyyy',
43});
44        
45        $('.portfolio-main-wrapper').bizbir();
46
47        $.fn.viewportChecker = function(useroptions) {
48            // Define options and extend with user.
49            var options = {
50                classToAdd: 'visible',
51                offset: 100,
52                callbackFunction: function(elem) {}
53            };
54            $.extend(options, useroptions);
55
56            // Cache the given element and height of the browser
57            var $elem = this,
58                windowHeight = $(window).height();
59
60            this.checkElements = function() {
61                // Set some vars to check with
62                var scrollElem = ((navigator.userAgent.toLowerCase().indexOf('webkit') != -1) ? 'body' : 'html'),
63                    viewportTop = $(scrollElem).scrollTop(),
64                    viewportBottom = (viewportTop + windowHeight);
65
66                $elem.each(function() {
67                    var $obj = $(this);
68                    // If class already exists; quit
69                    if ($obj.hasClass(options.classToAdd)) {
70                        return;
71                    }
72
73                    // define the top position of the element and include the offset which makes is appear earlier or later
74                    var elemTop = Math.round($obj.offset().top) + options.offset,
75                        elemBottom = elemTop + ($obj.height());
76
77                    // Add class if in viewport
78                    if ((elemTop < viewportBottom) && (elemBottom > viewportTop)) {
79                        $obj.addClass(options.classToAdd);
80
81                        // Do the callback function. Callback will send the jQuery object as parameter
82                        options.callbackFunction($obj);
83                    }
84                });
85            };
86
87            // Run checkelements on load and scroll.
88            $(window).on('scroll', this.checkElements);
89            this.checkElements();
90
91            // On resize change the height var.
92            $(window).on('resize', function(e) {
93                windowHeight = e.currentTarget.innerHeight;
94            });
95
96        };
97
98        // Search in header.
99        if ($('.search-icon').length > 0) {
100            $('.search-icon').on('click', function(e) {
101                e.preventDefault();
102                $('.search-box-wrap').slideToggle();
103            });
104        }
105		$('#search-button, .search-box-blur').on('click', function( e ) {
106			$('#search-button, .search-box-blur, .custom-search-container, #page.site').toggleClass('search-open');
107		});
108
109
110		$('.btn-close-sidebar').on('click',function(e){
111			e.preventDefault();
112			$.sidr('close', 'sidr-pull-sidebar');
113		});
114
115		// Mobile menu.
116		$( '#mobile-trigger' ).sidr({
117			timing: 'ease-in-out',
118			speed: 300,
119			source: '#mob-menu',
120			name: 'sidr-main',
121			renaming: false,
122			side: 'right',
123		});
124
125        $('#sidr-main').find('.sub-menu,.flat-mega-memu').before('<span class="dropdown-toggle"><strong class="dropdown-icon"></strong>');
126
127        $('#sidr-main').find('.dropdown-toggle').on('click', function(e) {
128            e.preventDefault();
129            $(this).next('.sub-menu,.flat-mega-memu').slideToggle();
130            $(this).toggleClass('toggle-on');
131        });
132
133        // Counter up.
134        $('.counter-nos').counterUp({
135            delay: 10,
136            time: 1000
137        });
138
139        // Fixed header.
140        $(window).on('scroll', function() {
141            if ($(window).scrollTop() > $('.sticky-enabled').offset().top && !($('.sticky-enabled').hasClass('sticky-header'))) {
142                $('.sticky-enabled').addClass('sticky-header');
143            } else if (0 === $(window).scrollTop()) {
144                $('.sticky-enabled').removeClass('sticky-header');
145            }
146        });
147
148
149        // Slick carousel column 1.
150        $(".normal-carousel").slick( );
151
152
153        // Skil bar.
154        jQuery('.skillbar').each(function() {
155            jQuery(this).find('.skillbar-bar').animate({
156                width: jQuery(this).attr('data-percent')
157            }, 3000);
158        });
159
160        // Lighbox.
161        jQuery('a[data-gal]').each(function() {
162            jQuery(this).attr('rel', jQuery(this).data('gal'));
163        });
164        jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({
165            animationSpeed: 'slow',
166            slideshow: false,
167            overlay_gallery: false,
168            theme: 'light_square',
169            social_tools: false,
170            deeplinking: false
171        });
172
173
174        // Implement go to top.
175        var $scroll_obj = $('#btn-scrollup');
176        $(window).on('scroll', function() {
177            if ($(this).scrollTop() > 100) {
178                $scroll_obj.fadeIn();
179            } else {
180                $scroll_obj.fadeOut();
181            }
182        });
183
184        $scroll_obj.on('click', function() {
185            $('html, body').animate({
186                scrollTop: 0
187            }, 600);
188            return false;
189        });
190  // FAQ Accordion.
191		$('.faq-accordion').accordionjs(); {
192		}
193		        $('a[href*="#demosz"]:not([href=""])').on('click', function() {
194            if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
195                var target = $(this.hash);
196                target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
197                if (target.length) {
198                    $('html, body').animate({
199                        scrollTop: target.offset().top - 0
200                    }, 1000);
201                    return false;
202                }
203            }
204        });
205
206    });
207
208})(jQuery);
209
210
211

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.