PageSourceSearch

https://www.simplefirst.com/js/jquery.main.js

js simplefirst.com collected 2026-10-05 06:55:23 UTC 8,582 bytes, 288 lines download raw bytes

1jQuery(function () {
2    initComingSoonCountDown();
3    initPortfolioPaging();
4    initCarouselPortfolio();
5    initPortfolioSorting();
6    initMasonryGallery();
7    initStandartGallery();
8    initCarouselGallerySlider();
9    initSubMenuToSidebar();
10    initArchivesOpenClose();
11    initTabNav();
12    initWebpImagesChecker();
13});
14
15$(window).load(function()
16{
17
18    $('.loaded-block').fadeOut();
19});
20
21function initWebpImagesChecker() {
22    Modernizr.on('webp', function (result) {
23        // `result == Modernizr.webp`
24        console.log(result);  // either `true` or `false`
25        if (result) {
26          // Has WebP support
27          
28        }
29        else {
30          // No WebP support
31         
32        }
33      });
34}
35
36
37
38// "tab" key handling
39function initTabNav() {
40	jQuery('#main-menu').tabNav({
41		items: 'li'
42	});
43}
44
45
46/*Coming Soon*/
47function initComingSoonCountDown() {
48    var condition = $('.comingSoonTimerHolder').size()
49        // && false
50    ;init(condition);
51
52    function init(condition) {
53        if(condition || condition == null) {
54            $('.comingSoonTimerHolder').countdowntimer({
55                dateAndTime : "2020/01/01 00:00:00",
56                size : "lg",
57                regexpMatchFormat : "([0-9]{1,3}):([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})",
58                regexpReplaceWith : '<div class="column"><span>$1</span><p>days</p></div><div class="column"><span>$2</span><p>hours</p></div><div class="column"><span>$3</span><p>minutes</p></div><div class="column"><span>$4</span><p>seconds</p></div>'
59            });
60        }
61    }
62}
63/*End Coming Soon*/
64
65/*======================Portfolio =============================*/
66
67function initPortfolioPaging() {
68    var condition = $('.modulesDetailPaging').length
69        // && false
70    ;init(condition);
71
72    function init(condition) {
73        if(condition || condition == null) {
74            var currentId = $('[data-current_id]').data('current_id');
75            var index = $('.hiddenModulesListHolder [data-id="' + currentId + '"]').index();
76            var prevIndex = index - 1;
77            var nextIndex = index + 1;
78
79            if(prevIndex >= 0 ) {
80                $('.modulesDetailPaging .prev').show();
81                $('.modulesDetailPaging .prev').attr('href',$('.hiddenModulesListHolder .hiddenItem').eq(prevIndex).data('link'));
82                $('.modulesDetailPaging .prev .title').html($('.hiddenModulesListHolder .hiddenItem').eq(prevIndex).data('name'));
83            }
84
85            if(nextIndex < $('.hiddenModulesListHolder .hiddenItem').length) {
86                $('.modulesDetailPaging .next').show();
87                $('.modulesDetailPaging .next').attr('href',$('.hiddenModulesListHolder .hiddenItem').eq(nextIndex).data('link'));
88                $('.modulesDetailPaging .next .title').html($('.hiddenModulesListHolder .hiddenItem').eq(nextIndex).data('name'));
89            }
90        }
91    }
92}
93
94
95function initCarouselPortfolio()
96{
97    var condition = $('.portfolioCarouselHolder').size()
98        // && false
99    ;init(condition);
100
101    function init(condition)
102    {
103        if(condition || condition == null)
104        {
105            var carouselGallerySlider = $('.portfolioCarouselHolder .mask').bxSlider({
106                slideSelector : $('.carouselGalleryHolder .slide'),
107                pager : true,
108                responsive: true,
109                controls : false,
110                auto : true,
111
112                moveSlides: 1,
113                shrinkItems: true,
114            });
115        }
116    }
117}
118
119function initPortfolioSorting() {
120    var condition = $('.portfolioFilterGridHolder').size()
121        // && false
122    ;init(condition);
123
124    function init(condition) {
125        if(condition || condition == null) {
126            $('.portfolioFilterGridHolder .cell').hide();
127            $grid = $('.portfolioFilterGridHolder').isotope({
128                itemSelector: '.cell',
129                percentPosition : true
130            });
131
132            $grid.imagesLoaded().progress( function(instance, image) {
133                $('.portfolioFilterGridHolder .cell').show();
134                $grid.isotope('layout');
135            });
136
137            $('.portfolioFilterBTNHolder [data-filter]').on( 'click', function() {
138                var _this = $(this);
139                var filterValue = _this.attr('data-filter');
140
141                $('.portfolioFilterBTNHolder li').removeClass('active');
142                _this.closest('li').addClass('active');
143
144                $grid.isotope({ filter: filterValue });
145
146                return false;
147            });
148        }
149    }
150}
151/*======================End portfolio =============================*/
152
153/*======================Galleries  =============================*/
154
155
156function initMasonryGallery() {
157    var condition = $('.masonryGalleryHolder').size()
158        // && false
159    ;init(condition);
160
161    function init(condition) {
162        if(condition || condition == null) {
163            var $grid = $('.masonryGalleryHolder').masonry();
164            $grid.imagesLoaded().progress( function() {
165                $grid.masonry('layout');
166            });
167
168            $('.masonryGalleryHolder a').fancybox({
169                nextEffect : 'fade',
170                prevEffect : 'fade'
171
172            });
173        }
174    }
175}
176
177function initStandartGallery()
178{
179    var condition = $('.lightboxGalleryHolder').size()
180        // && false
181    ;init(condition);
182
183    function init(condition)
184    {
185        if(condition || condition == null)
186        {
187            $('.lightboxGalleryHolder a').fancybox({
188                nextEffect : 'fade',
189                prevEffect : 'fade'
190
191            });
192        }
193    }
194}
195
196function initCarouselGallerySlider()
197{
198    var condition = $('.carouselGalleryHolder').size()
199        // && false
200    ;init(condition);
201
202    function init(condition)
203    {
204        if(condition || condition == null)
205        {
206            var carouselGallerySlider = $('.carouselGalleryHolder .mask').bxSlider({
207                slideSelector : $('.carouselGalleryHolder .slide'),
208                pager : false,
209                controls : false,
210                auto : true,
211                minSlides: 1,
212                maxSlides: 3,
213                moveSlides: 1,
214                slideWidth: 360,
215                shrinkItems: true,
216                slideMargin : 30
217            });
218
219            $('.carouselGalleryHolder .btn-next').click(function()
220            {
221                carouselGallerySlider.goToNextSlide();
222
223                return false;
224            });
225
226            $('.carouselGalleryHolder .btn-prev').click(function()
227            {
228                carouselGallerySlider.goToPrevSlide();
229
230                return false;
231            });
232        }
233    }
234}
235
236/*======================End Galleries  =============================*/
237
238
239/*======================Static  =============================*/
240function initSubMenuToSidebar()
241{
242    var menuSelector = '.navigation ul:eq(0)';
243    var sidebarPlaceHolderSelect = '.sidebarSubmenuPlaceHolder';//side-navigation
244    var activeSelector = '.active';
245
246    var condition = $(sidebarPlaceHolderSelect).size() && $(menuSelector + ' ' + activeSelector + ":has(ul)").size()
247        // && false
248    ;init(condition);
249
250    function init(condition)
251    {
252        if(condition || condition == null)
253        {
254            copyToSidebar();
255        }
256    }
257
258    function copyToSidebar()
259    {
260        var submenuCopy = $(menuSelector).find(activeSelector + ':first ul:eq(0)').clone();
261
262        submenuCopy.addClass('sidebar-nav');
263        $(sidebarPlaceHolderSelect).append(submenuCopy);
264        $(sidebarPlaceHolderSelect).find('ul').removeAttr('class');
265        $(sidebarPlaceHolderSelect).find('ul').addClass('side-nav');
266        $(sidebarPlaceHolderSelect).find('ul ul').remove();
267    }
268}
269/*======================end Static  =============================*/
270
271function initArchivesOpenClose() {
272    var condition = $('.archivesListOpenClose').size()
273    // && false
274    ;init(condition);
275
276    function init(condition) {
277        if (condition || condition == null) {
278            $('.archives>li').openClose({
279                activeClass: 'active',
280                opener: '.opener',
281                slider: '.slide',
282                animSpeed: 400,
283                effect: 'slide'
284            });
285        }
286    }
287}
288

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.