PageSourceSearch

http://katalog.stroykombinat.kz/design/stroy/js/custom.js

js stroykombinat.kz collected 2026-10-07 19:43:10 UTC 8,764 bytes, 352 lines download raw bytes

1"use strict";
2// Global vars
3var TWITTER_USERNAME = 'envato',
4    GOOGLE_MAP_LAT = 40.7564971,
5    GOOGLE_MAP_LNG = -73.9743277;
6
7
8// Countdown
9$(function() {
10    $('.countdown').each(function() {
11        var count = $(this);
12        $(this).countdown({
13            zeroCallback: function(options) {
14                var newDate = new Date(),
15                    newDate = newDate.setHours(newDate.getHours() + 130);
16
17                $(count).attr("data-countdown", newDate);
18                $(count).countdown({
19                    unixFormat: true
20                });
21            }
22        });
23    });
24});
25
26
27// Bootstrap carousel
28$('.carousel').carousel({
29    interval: 6000
30});
31
32// Responsive video
33$("body").fitVids();
34
35// Sticky search
36if ($('body').hasClass('sticky-search')) {
37    var theLoc = $('.search-area').position().top;
38    if ($('body').hasClass('sticky-header')) {
39        var header_h = $('header.main').outerHeight();
40    } else {
41        header_h = 0;
42    }
43
44    $(window).scroll(function() {
45        if (theLoc >= $(window).scrollTop()) {
46            if ($('.search-area').hasClass('fixed')) {
47                $('.search-area').removeClass('fixed').css({
48                    top: 0
49                });
50            }
51        } else {
52            if (!$('.search-area').hasClass('fixed')) {
53                $('.search-area').addClass('fixed').css({
54                    top: header_h
55                });
56            }
57        }
58    });
59}
60
61// Sticky header
62if ($('body').hasClass('sticky-header')) {
63    var theLoc = $('header.main').position().top;
64    $(window).scroll(function() {
65        if (theLoc >= $(window).scrollTop()) {
66            if ($('header.main').hasClass('fixed')) {
67                $('header.main').removeClass('fixed');
68            }
69        } else {
70            if (!$('header.main').hasClass('fixed')) {
71                $('header.main').addClass('fixed');
72            }
73        }
74    });
75}
76
77// Price slider
78$("#price-slider").ionRangeSlider({
79    min: 130,
80    max: 575,
81    type: 'double',
82    prefix: "$",
83    prettify: false,
84    hasGrid: false
85});
86
87// Responsive navigation
88$('#flexnav').flexNav();
89
90
91
92// Lighbox text
93$('.popup-text').magnificPopup({
94    removalDelay: 500,
95    closeBtnInside: true,
96    callbacks: {
97        beforeOpen: function() {
98            this.st.mainClass = this.st.el.attr('data-effect');
99        }
100    },
101    midClick: true
102});
103
104// Lightbox iframe
105$('.popup-iframe').magnificPopup({
106    dispableOn: 700,
107    type: 'iframe',
108    removalDelay: 160,
109    mainClass: 'mfp-fade',
110    preloader: false
111});
112
113
114$('#star-rating > li').each(function() {
115    var list = $(this).parent(),
116        listItems = list.children(),
117        itemIndex = $(this).index();
118
119    $(this).hover(function() {
120        for (var i = 0; i < listItems.length; i++) {
121            if (i <= itemIndex) {
122                $(listItems[i]).addClass('hovered');
123            } else {
124                break;
125            }
126        };
127        $(this).click(function() {
128            for (var i = 0; i < listItems.length; i++) {
129                if (i <= itemIndex) {
130                    $(listItems[i]).addClass('selected');
131                } else {
132                    $(listItems[i]).removeClass('selected');
133                }
134            };
135        });
136    }, function() {
137        listItems.removeClass('hovered');
138    });
139});
140
141
142// Bootstrap tooltips
143$('[data-toggle="tooltip"]').tooltip();
144
145
146
147// Twitter
148$("#twitter").tweet({
149    username: TWITTER_USERNAME,
150    count: 3
151});
152
153$("#twitter-ticker").tweet({
154    username: TWITTER_USERNAME,
155    page: 1,
156    count: 20
157});
158
159
160// Checkboxes and radio
161$('.i-check, .i-radio').iCheck({
162    checkboxClass: 'i-check',
163    radioClass: 'i-radio'
164});
165
166
167// Item quantity control (shopping cart)
168$(".cart-item-plus").click(function() {
169    var currentVal = parseInt($(this).prev(".cart-quantity").val());
170
171    if (!currentVal || currentVal == "" || currentVal == "NaN") currentVal = 0;
172
173    $(this).prev(".cart-quantity").val(currentVal + 1);
174document.cart.submit();
175});
176
177$(".cart-item-minus").click(function() {
178    var currentVal = parseInt($(this).next(".cart-quantity").val());
179    if (currentVal == "NaN") currentVal = 0;
180    if (currentVal > 1) {
181        $(this).next(".cart-quantity").val(currentVal - 1);
182document.cart.submit();
183    }
184});
185
186
187// Card form
188$('.form-group-cc-number input').payment('formatCardNumber');
189$('.form-group-cc-date input').payment('formatCardExpiry');
190$('.form-group-cc-cvc input').payment('formatCardCVC');
191
192
193// Google map
194if ($('#map-canvas').length) {
195    var map,
196        service;
197    jQuery(function($) {
198        $(document).ready(function() {
199            var latlng = new google.maps.LatLng(GOOGLE_MAP_LAT, GOOG
199LE_MAP_LNG);
200            var myOptions = {
201                zoom: 14,
202                center: latlng,
203                mapTypeId: google.maps.MapTypeId.ROADMAP
204            };
205
206            map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
207
208
209            var marker = new google.maps.Marker({
210                position: latlng,
211                map: map
212            });
213            marker.setMap(map);
214
215
216            $('a[href="#google-map-tab"]').on('shown.bs.tab', function(e) {
217                google.maps.event.trigger(map, 'resize');
218                map.setCenter(latlng);
219            });
220        });
221    });
222}
223
224
225$('.bg-parallax').each(function() {
226    var $obj = $(this);
227
228    $(window).scroll(function() {
229        // var yPos = -($(window).scrollTop() / $obj.data('speed'));
230        var animSpeed;
231        if ($obj.hasClass('bg-blur')) {
232            animSpeed = 10;
233        } else {
234            animSpeed = 15;
235        }
236        var yPos = -($(window).scrollTop() / animSpeed);
237        var bgpos = '50% ' + yPos + 'px';
238        $obj.css('background-position', bgpos);
239
240    });
241});
242
243// Document ready functions
244$(document).ready(function() {
245
246
247    $('html').niceScroll({
248        cursorcolor: "#000",
249        cursorborder: "0px solid #fff",
250        railpadding: {
251            top: 0,
252            right: 0,
253            left: 0,
254            bottom: 0
255        },
256        cursorwidth: "5px",
257        cursorborderradius: "0px",
258        cursoropacitymin: 0,
259        cursoropacitymax: 0.7,
260        boxzoom: true,
261        horizrailenabled: false,
262        zindex: 9999
263    });
264
265
266    // Owl Carousel
267    var owlCarousel = $('#owl-carousel'),
268        owlItems = owlCarousel.attr('data-items'),
269        owlCarouselSlider = $('#owl-carousel-slider'),
270        owlNav = owlCarouselSlider.attr('data-nav');
271    // owlSliderPagination = owlCarouselSlider.attr('data-pagination');
272
273    owlCarousel.owlCarousel({
274        items: owlItems,
275        navigation: true,
276        navigationText: ['', '']
277    });
278
279    owlCarouselSlider.owlCarousel({
280        slideSpeed: 300,
281        paginationSpeed: 400,
282        // pagination: owlSliderPagination,
283        singleItem: true,
284        navigation: true,
285        navigationText: ['', ''],
286        transitionStyle: 'goDown',
287        // autoPlay: 4500
288    });
289
290
291    // Twitter Ticker
292    var ul = $('#twitter-ticker').find(".tweet-list");
293    var ticker = function() {
294        setTimeout(function() {
295            ul.find('li:first').animate({
296                marginTop: '-9em',
297                opacity: 0
298            }, 700, function() {
299                $(this).detach().appendTo(ul).removeAttr('style');
300            });
301            ticker();
302        }, 5000);
303    };
304    ticker();
305
306
307     // footer always on bottom
308    var docHeight = $(window).height();
309   var footerHeight = $('#main-footer').height();
310   var footerTop = $('#main-footer').position().top + footerHeight;
311   
312   if (footerTop < docHeight) {
313    $('#main-footer').css('margin-top', (docHeight - footerTop) + 'px');
314   }
315
316});
317
318
319// Lighbox gallery
320$('#popup-gallery').each(function() {
321    $(this).magnificPopup({
322        delegate: 'a.popup-gallery-image',
323        type: 'image',
324        gallery: {
325            enabled: true
326        }
327    });
328});
329
330// Lighbox gallery
331$('#popup-gallery').each(function() {
332    $(this).magnificPopup({
333        delegate: 'a.popup-gallery-image',
334        type: 'image',
335        gallery: {
336            enabled: true
337        }
338    });
339});
340
341// Lighbox image
342$('.popup-image').magnificPopup({
343    type: 'image'
344});
345
346$(window).load(function() {
347    if ($(window).width() > 992) {
348        $('#masonry').masonry({
349            itemSelector: '.col-masonry'
350        });
351    }
352});

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.