PageSourceSearch

https://cami.co.za/wp-content/themes/total/js/total-custom.js?ver=1.01

js cami.co.za collected 2026-10-09 21:57:26 UTC 6,973 bytes, 265 lines download raw bytes

1/**
2 * Total Custom JS
3 *
4 * @package Total
5 *
6 * Distributed under the MIT license - http://opensource.org/licenses/MIT
7 */
8
9jQuery(function($){
10
11  if($('.ht-sticky-header').length > 0){
12    $(window).scroll(function(){
13      if($(window).scrollTop() > 200 ){
14        $('#ht-masthead').addClass('ht-sticky');
15      }else{
16        $('#ht-masthead').removeClass('ht-sticky');
17      }
18    });
19  }
20
21  if($('#ht-bx-slider .ht-slide').length > 0){
22    $('#ht-bx-slider').owlCarousel({
23        autoplay : true,
24        items : 1,
25        loop : true,
26        nav: true,
27        dots : false,
28        autoplayTimeout : 7000,
29        animateOut: 'fadeOut'
30    });
31  }
32
33  $('.ht-testimonial-slider').owlCarousel({
34      autoplay : true,
35      items : 1,
36      loop : true,
37      nav: true,
38      dots : false,
39      autoplayTimeout : 7000,
40      navText : ['<i class="fa fa-angle-left" aria-hidden="true"></i>', '<i class="fa fa-angle-right" aria-hidden="true"></i>'],
41  });
42
43  $(".ht_client_logo_slider").owlCarousel({
44      autoplay : true,
45      items : 5,
46      loop : true,
47      nav: false,
48      dots : false,
49	  autoplayTimeout : 7000,
50      responsive : {
51        0 : {
52            items : 2,
53        },
54        768 : {
55            items : 3,
56        },
57        979 : {
58            items : 4,
59        },
60        1200 : {
61            items : 5,
62        }
63      }   
64  });
65    
66  $('.ht-portfolio-image').nivoLightbox();
67  
68  var sf = $('.ht-menu > ul').superfish({
69      delay:       500,                            // one second delay on mouseout
70      animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
71      speed:       'fast',                          // faster animation speed
72  });
73
74  $(window).resize(function(){
75      if($(window).width() < 1000){
76          sf.superfish('destroy');
77          $('.ht-dropdown').removeClass('ht-opened');
78      }else{
79          sf.superfish('init');
80      }
81  }).resize();
82
83  $('.menu-item-has-children > a').append('<span class="ht-dropdown"></span>');
84
85  $('.ht-dropdown').on('click', function(){
86      $(this).parent('a').next('ul').slideToggle();
87      $(this).toggleClass('ht-opened');
88      return false;
89  })
90    
91  $('.ht-service-excerpt h5').click(function(){
92      $(this).next('.ht-service-text').slideToggle();
93      $(this).parents('.ht-service-post').toggleClass('ht-active');
94  });
95  
96  $('.ht-service-icon').click(function(){
97      $(this).next('.ht-service-excerpt').find('.ht-service-text').slideToggle();
98      $(this).parent('.ht-service-post').toggleClass('ht-active');
99  });
100
101  $('.toggle-bar').click(function(){
102      $(this).next('.ht-menu').slideToggle();
103  });
104
105  setTimeout(function(){
106    $.stellar({
107      horizontalScrolling: false, 
108      responsive: true,
109    });
110  }, 3000 );
111  
112  $('.ht-team-counter-wrap').waypoint(function() {
113      setTimeout(function() {
114          $('.odometer1').html($('.odometer1').data('count'));
115      }, 500);
116      setTimeout(function() {
117          $('.odometer2').html($('.odometer2').data('count'));
118      }, 1000);
119      setTimeout(function() {
120          $('.odometer3').html($('.odometer3').data('count'));
121      }, 1500);
122      setTimeout(function() {
123          $('.odometer4').html($('.odometer4').data('count'));
124      }, 2000);
125      }, {
126      offset: 800,
127      triggerOnce: true
128  });
129
130  if($('.ht-sticky-header').length > 0){
131    var onpageOffset = 74;
132  }else{
133    onpageOffset = 0
134  }
135
136  $('.ht-sticky-header .ht-menu').onePageNav({
137    currentClass: 'current',
138    changeHash: false,
139    scrollSpeed: 750,
140    scrollThreshold: 0.1,
141    scrollOffset: onpageOffset
142  });
143
144  // *only* if we have anchor on the url
145  var anchorId = window.location.hash;
146  anchorId = anchorId.replace('/', '');
147  if( $(anchorId).length > 0 ) {
148      $('html, body').animate({
149          scrollTop: $(anchorId).offset().top - onpageOffset
150      }, 1000 );        
151  }
152
153  $(window).scroll(function(){
154      if($(window).scrollTop() > 300){
155          $('#ht-back-top').removeClass('ht-hide');
156      }else{
157          $('#ht-back-top').addClass('ht-hide');
158      }
159  });
160
161  $('#ht-back-top').click(function(){
162      $('html,body').animate({scrollTop:0},800);
163  });
164
165  if( $('.ht-portfolio-posts').length > 0 ){
166
167  var first_class = $('.ht-portfolio-cat-name:first').data('filter');
168  $('.ht-portfolio-cat-name:first').addClass('active');
169
170  var $container = $('.ht-portfolio-posts').imagesLoaded( function() {
171  
172  $container.isotope({
173      itemSelector: '.ht-portfolio',
174      filter: first_class
175  });
176        
177  var elems = $container.isotope('getFilteredItemElements');
178
179  elems.forEach(function(item, index){
180    if ( index == 0 || index == 4 ) {
181      $( item ).addClass('wide');
182      var bg = $(item).find('.ht-portfolio-image').attr('href');
183      $( item ).find('.ht-portfolio-wrap').css('background-image', 'url('+bg+')');
184    }else{
185      $( item ).removeClass('wide');
186    }
187  });
188
189  GetMasonary();
190
191  setTimeout(function(){
192    $container.isotope({
193    itemSelector: '.ht-portfolio',
194    filter: first_class,
195  });
196  },2000);
197
198  $(window).on( 'resize', function () {
199     GetMasonary();
200  });
201
202}); 
203
204$('.ht-portfolio-cat-name-list').on( 'click', '.ht-portfolio-cat-name', function() {
205  var filterValue = $(this).attr('data-filter');
206  $container.isotope({ filter: filterValue });
207       
208    var elems = $container.isotope('getFilteredItemElements');
209    
210    elems.forEach(function(item, index){
211      if ( index == 0 || index == 4 ) {
212        $( item ).addClass('wide');
213        var bg = $(item).find('.ht-portfolio-image').attr('href');
214        $( item ).find('.ht-portfolio-wrap').css('background-image', 'url('+bg+')');
215      }else{
216        $( item ).removeClass('wide');
217      }
218    }); 
219
220    GetMasonary();      
221  
222	  var filterValue = $(this).attr('data-filter');
223	  $container.isotope({ filter: filterValue });
224        
225	  $('.ht-portfolio-cat-name').removeClass('active');
226	  $(this).addClass('active');
227});
228
229function GetMasonary(){        
230   var winWidth = window.innerWidth;   
231   if (winWidth > 580) {
232                   
233      $container.find('.ht-portfolio').each(function () { 
234          var image_width = $(this).find('img').width();
235          if($(this).hasClass('wide')){
236            $(this).find('.ht-portfolio-wrap').css( { 
237                height : (image_width*2) + 15 + 'px'
238            });
239          }else{
240            $(this).find('.ht-portfolio-wrap').css( { 
241                height : image_width + 'px'
242            });
243          }
244      }); 
245
246  }else {
247      $container.find('.ht-portfolio').each(function () { 
248          var image_width = $(this).find('img').width();
249          if($(this).hasClass('wide')){
250            $(this).find('.ht-portfolio-wrap').css( { 
251                height : (image_width*2) + 8 + 'px'
252            });
253          }else{
254            $(this).find('.ht-portfolio-wrap').css( { 
255                height : image_width + 'px'
256            });
257          }
258      }); 
259  }    
260}
261
262}
263
264});
265

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.