PageSourceSearch

https://bisdammam.com/js/theme.js

js bisdammam.com collected 2026-10-02 19:38:09 UTC 15,662 bytes, 623 lines download raw bytes

1
2"use strict";
3
4
5
6
7// Prealoder
8 function prealoader () {
9   if ($('#loader').length) {
10     $('#loader').fadeOut(); // will first fade out the loading animation
11     $('#loader-wrapper').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
12     $('body').delay(350).css({'overflow':'visible'});
13  };
14 }
15
16
17// placeholder remove
18function removePlaceholder () {
19  if ($("input,textarea").length) {
20    $("input,textarea").each(
21            function(){
22                $(this).data('holder',$(this).attr('placeholder'));
23                $(this).on('focusin', function() {
24                    $(this).attr('placeholder','');
25                });
26                $(this).on('focusout', function() {
27                    $(this).attr('placeholder',$(this).data('holder'));
28                });
29                
30        });
31  }
32}
33
34
35// Theme-banner slider 
36function BannerSlider () {
37  if ($("#main-banner-slider").length) {
38    $("#main-banner-slider").revolution({
39      sliderType:"standard",
40      sliderLayout:"auto",
41      loops:false,
42      delay:7000,
43      navigation: {
44         
45         bullets: {
46                  enable: true,
47                  hide_onmobile: false,
48                  style: "uranus",
49                  hide_onleave: false,
50                  direction: "horizontal",
51                  h_align: "center",
52                  v_align: "bottom",
53                  h_offset: -15,
54                  v_offset: 30,
55                  space: 10,
56                  tmp: '<span class="tp-bullet-inner"></span>'
57              }
58
59      },
60      responsiveLevels:[2220,1183,975,751],
61                gridwidth:[1170,970,770,350],
62                gridheight:[456,456,456,400],
63                shadow:0,
64                spinner:"off",
65                autoHeight:"off",
66                disableProgressBar:"on",
67                hideThumbsOnMobile:"off",
68                hideSliderAtLimit:0,
69                hideCaptionAtLimit:0,
70                hideAllCaptionAtLilmit:0,
71                debugMode:false,
72                fallbacks: {
73                  simplifyAll:"off",
74                  disableFocusListener:false,
75                }   
76    }); 
77  };
78}
79
80
81// Theme-banner slider 
82function BannerSliderTwo () {
83  if ($("#main-banner-slider-two").length) {
84    $("#main-banner-slider-two").revolution({
85      sliderType:"standard",
86      sliderLayout:"auto",
87      loops:false,
88      delay:7000,
89      navigation: {
90          
91         bullets: {
92                  enable: true,
93                  hide_onmobile: false,
94                  style: "uranus",
95                  hide_onleave: false,
96                  direction: "horizontal",
97                  h_align: "center",
98                  v_align: "bottom",
99                  h_offset: -15,
100                  v_offset: 30,
101                  space: 10,
102                  tmp: '<span class="tp-bullet-inner"></span>'
103              }
104
105      },
106      responsiveLevels:[2220,1183,975,751],
107                gridwidth:[1170,970,770,350],
108                gridheight:[420,420,420,400],
109                shadow:0,
110                spinner:"off",
111                autoHeight:"off",
112                disableProgressBar:"on",
113                hideThumbsOnMobile:"off",
114                hideSliderAtLimit:0,
115                hideCaptionAtLimit:0,
116                hideAllCaptionAtLilmit:0,
117                debugMode:false,
118                fallbacks: {
119                  simplifyAll:"off",
120                  disableFocusListener:false,
121                }   
122    }); 
123  };
124}
125
126
127// WOW animation 
128function wowAnimation () {
129  if($('.wow').length) {
130    var wow = new WOW(
131    {
132      boxClass:     'wow',      // animated element css class (default is wow)
133      animateClass: 'animated', // animation css class (default is animated)
134      offset:       50,          // distance to the element when triggering the animation (default is 0)
135      mobile:       true,       // trigger animations on mobile devices (default is true)
136      live:         true,       // act on asynchronously loaded content (default is true)
137      callback:     function(box) {
138        // the callback is fired every time an animation is started
139        // the argument that is passed in is the DOM node being animated
140      },
141      scrollContainer: null // optional scroll container selector, otherwise use window
142    }
143  );
144  wow.init();
145  }
146}
147
148// Fancybox 
149function FancypopUp () {
150  if ($(".fancybox").length) {
151    $(".fancybox").fancybox({
152      openEffect  : 'elastic',
153        closeEffect : 'elastic',
154         helpers : {
155            overlay : {
156                css : {
157                    'background' : 'rgba(0, 0, 0, 0.6)'
158                }
159            }
160        }
161    });
162  };
163}
164
165// Fancybox Video
166function FancypopUpVideo () {
167  if ($(".fancy_video").length) {
168      $(".fancy_video").fancybox({
169      maxWidth  : 1080,
170      maxHeight : 720,
171      fitToView : false,
172      width   : '95%',
173      height    : '85%',
174      autoSize  : false,
175      closeClick  : false,
176      openEffect  : 'none',
177      closeEffect : 'none'
178    });
179  };
180}
181
182// Theme Slider
183function themeSlider () {
184  if($('.theme-slider').length) {
185    $('.theme-slider').owlCarousel({
186        loop:true,
187        nav:true,
188        navText:false,
189        dots:false,
190        autoplay:true,
191        autoplayTimeout:333500,
192        autoplaySpeed:1000,
193        lazyLoad:true,
194        responsive:{
195            0:{
196                items:2
197            },
198            651:{
199                items:3
200            },
201            992:{
202                items:4
203            }
204        }
205    })
206  }
207}
208
209// Client Slider
210function clientSlider () {
211  if($('.client-slider-wrapper').length) {
212    $('.client-slider-wrapper').owlCarousel({
213        loop:true,
214        nav:true,
215        navText:false,
216        dots:false,
217        autoplay:true,
218        autoplayTimeout:3500,
219        autoplaySpeed:1000,
220        lazyLoad:true,
221        responsive:{
222            0:{
223                items:1
224            },
225            651:{
226                items:1
227            },
228            992:{
229                items:2
230            }
231        }
232    })
233  }
234}
235
236
237// Partner Slider
238function partnerSlider () {
239  if($('.partner-slider').length) {
240    $('.partner-slider').owlCarousel({
241        loop:true,
242        nav:false,
243        navText:false,
244        dots:false,
245        autoplay:true,
246        autoplayTimeout:3000,
247        autoplaySpeed:1250,
248        lazyLoad:true,
249        responsive:{
250            0:{
251                items:1
252            },
253            651:{
254                items:2
255            },
256            992:{
257                items:4
258            }
259        }
260    })
261  }
262}
263
264// Mixitup gallery
265function mixitupGallery () {
266  if ($("#mixitup-list").length) {
267    $("#mixitup-list").mixItUp()
268  };
269}
270
271// Counter function
272function CounterNumberChanger () {
273  var timer = $('.timer');
274  if(timer.length) {
275    timer.appear(function () {
276      timer.countTo();
277    })
278  }
279}
280
281// Scroll to top
282function scrollToTop () {
283  if ($('.scroll-top').length) {
284
285    //Check to see if the window is top if not then display button
286    $(window).on('scroll', function (){
287      if ($(this).scrollTop() > 200) {
288        $('.scroll-top').fadeIn();
289      } else {
290        $('.scroll-top').fadeOut();
291      }
292    });
293    
294    //Click event to scroll to top
295    $('.scroll-top').on('click', function() {
296      $('html, body').animate({scrollTop : 0},1500);
297      return false;
298    });
299  }
300}
301
302
303
304//Contact Form Validation
305function contactFormValidation () {
306  if($('.form-validation').length){
307    $('.form-validation').validate({ // initialize the plugin
308      rules: {
309        name: {
310          required: true
311        },
312        email: {
313          required: true,
314          email: true
315        },
316        sub: {
317          required: true
318        },
319        message: {
320          required: true
321        }
322      },
323      submitHandler: function(form) {
324                $(form).ajaxSubmit({
325                    success: function() {
326                        $('.form-validation :input').attr('disabled', 'disabled');
327                        $('.form-validation').fadeTo( "slow", 1, function() {
328                            $(this).find(':input').attr('disabled', 'disabled');
329                            $(this).find('label').css('cursor','default');
330                            $('#alert_success').fadeIn();
331                        });
332                    },
333                    error: function() {
334                        $('.form-validation').fadeTo( "slow", 1, function() {
335                            $('#alert_error').fadeIn();
336                        });
337                    }
338                });
339            }
340        });
341  }
342}
343
344// Close suddess Alret
345function closeSuccessAlert () {
346  if($('.closeAlert').length) {
347    $(".closeAlert").on('click', function(){
348      $(".alert_wrapper").fadeOut();
349    });
350    $(".closeAlert").on('click', function(){
351      $(".alert_wrapper").fadeOut();
352    })
353  }
354}
355
356
357// Sticky header
358function stickyHeader () {
359  if ($('.main-menu').length) {
360    var sticky = $('.main-menu'),
361        scroll = $(window).scrollTop();
362
363    if (scroll >= 192) sticky.addClass('fixed');
364    else sticky.removeClass('fixed');
365    
366  };
367}
368
369
370// toggle menu for mobile
371function mobileDropdown () {
372  if($('.main-menu').length) {
373    $('.main-menu nav ul li.dropdown-holder').append(function () {
374      return '<i class="fa fa-angle-down" aria-hidden="true"></i>';
375    });
376    $('.main-menu nav ul li.dropdown-holder .fa').on('click', function () {
377      $(this).parent('li').children('ul').slideToggle();
378    }); 
379  }
380}
381
382
383
384
385// Accordion panel
386function themeAccrodion () {
387  if ($('.theme-accordion > .panel').length) {
388    $('.theme-accordion > .panel').on('show.bs.collapse', function (e) {
389          var heading = $(this).find('.panel-heading');
390          heading.addClass("active-panel");
391          
392    });
393    
394    $('.theme-accordion > .panel').on('hidden.bs.collapse', function (e) {
395        var heading = $(this).find('.panel-heading');
396          heading.removeClass("active-panel");
397          //setProgressBar(heading.get(0).id);
398    });
399
400  };
401}
402
403// DOM ready function
404jQuery(document).on('ready', function() {
405	(function ($) {
406	   removePlaceholder ();
407     BannerSlider ();
408     BannerSliderTwo ();
409     wowAnimation ();
410     FancypopUp ();
411     FancypopUpVideo ();
412     themeSlider ();
413     clientSlider ();
414     mixitupGallery ();
415     partnerSlider ();
416     CounterNumberChanger ();
417     scrollToTop ();
418     contactFormValidation ();
419     closeSuccessAlert ();
420     mobileDropdown ();
421     themeAccrodion ();
422  })(jQuery);
423});
424
425
426// Window load function
427jQuery(window).on('load', function () {
428   (function ($) {
429		  prealoader ()
430  })(jQuery);
431 });
432
433
434// Window scroll function
435jQuery(window).on('scroll', function () {
436  (function ($) {
437    stickyHeader ();
438  })(jQuery);
439});
440
441
442jQuery(document).ready(function ($) {
443
444  $('#checkbox').change(function(){
445    setInterval(function () {
446        moveRight();
447    }, 3000);
448  });
449  
450  var slideCount = $('#slider ul li').length;
451  var slideWidth = $('#slider ul li').width();
452  var slideHeight = $('#slider ul li').height();
453  var sliderUlWidth = slideCount * slideWidth;
454  
455  $('#slider').css({ width: slideWidth, height: slideHeight });
456  
457  $('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });
458  
459    $('#slider ul li:last-child').prependTo('#slider ul');
460
461    function moveLeft() {
462        $('#slider ul').animate({
463            left: + slideWidth
464        }, 200, function () {
465            $('#slider ul li:last-child').prependTo('#slider ul');
466            $('#slider ul').css('left', '');
467        });
468    };
469
470    function moveRight() {
471        $('#slider ul').animate({
472            left: - slideWidth
473        }, 200, function () {
474            $('#slider ul li:first-child').appendTo('#slider ul');
475            $('#slider ul').css('left', '');
476        });
477    };
478
479    $('a.control_prev').click(function () {
480        moveLeft();
481    });
482
483    $('a.control_next').click(function () {
484        moveRight();
485    });
486
487});
488
489
490$('.slider').each(function() {
491  var $this = $(this);
492  var $group = $this.find('.slide_group');
493  var $slides = $this.find('.slide');
494  var bulletArray = [];
495  var currentIndex = 0;
496  var timeout;
497  
498  function move(newIndex) {
499    var animateLeft, slideLeft;
500    
501    advance();
502    
503    if ($group.is(':animated') || currentIndex === newIndex) {
504      return;
505    }
506    
507    bulletArray[currentIndex].removeClass('active');
508    bulletArray[newIndex].addClass('active');
509    
510    if (newIndex > currentIndex) {
511      slideLeft = '100%';
512      animateLeft = '-100%';
513    } else {
514      slideLeft = '-100%';
515      animateLeft = '100%';
516    }
517    
518    $slides.eq(newIndex).css({
519      display: 'block',
520      left: slideLeft
521    });
522    $group.animate({
523      left: animateLeft
524    }, function() {
525      $slides.eq(currentIndex).css({
526        display: 'none'
527      });
528      $slides.eq(newIndex).css({
529        left: 0
530      });
531      $group.css({
532        left: 0
533      });
534      currentIndex = newIndex;
535    });
536  }
537  
538  function advance() {
539    clearTimeout(timeout);
540    timeout = setTimeout(function() {
541      if (currentIndex < ($slides.length - 1)) {
542        move(currentIndex + 1);
543      } else {
544        move(0);
545      }
546    }, 4000);
547  }
548  
549  $('.next_btn').on('click', function() {
550    if (currentIndex < ($slides.length - 1)) {
551      move(currentIndex + 1);
552    } else {
553      move(0);
554    }
555  });
556  
557  $('.previous_btn').on('click', function() {
558    if (currentIndex !== 0) {
559      move(currentIndex - 1);
560    } else {
561      move(3);
562    }
563  });
564  
565  $.each($slides, function(index) {
566    var $button = $('<a class="slide_btn">&bull;</a>');
567    
568    if (index === currentIndex) {
569      $button.addClass('active');
570    }
571    $button.on('click', function() {
572      move(index);
573    }).appendTo('.slide_buttons');
574    bulletArray.push($button);
575  });
576  
577  advance();
578});
579
580$(function () {
581
582    "use strict";
583
584    var $bgobj = $(".ha-bg-parallax"); // assigning the object
585
586    $(window).on("scroll", function () {
587
588        var yPos = -($(window).scrollTop() / $bgobj.data('speed'));
589
590        // Put together our final background position
591
592        var coords = '100% ' + yPos + 'px';
593
594        // Move the background
595
596        $bgobj.css({ backgroundPosition: coords });
597
598    });
599        $('div.product-chooser').not('.disabled').find('div.product-chooser-item').on('click', function(){
600    $(this).parent().parent().find('div.product-chooser-item').removeClass('selected');
601    $(this).addClass('selected');
602    $(this).find('input[type="radio"]').prop("checked", true);
603    
604  });
605
606});
607
608jQuery(document).ready(function($) {
609  //create the slider
610  $('.cd-testimonials-wrapper').flexslider({
611    selector: ".cd-testimonials > li",
612    animation: "slide",
613    controlNav: true,
614    slideshow: false,
615    smoothHeight: true,
616    start: function() {
617      $('.cd-testimonials').children('li').css({
618        'opacity': 1,
619        'position': 'relative'
620      });
621    }
622  });
623});

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.