phcthemes_web_theme_pack 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1106 @@
1
+ 'use strict';
2
+
3
+ (function ($) {
4
+ "use strict";
5
+
6
+ /*------------------------------------------------------------------
7
+ [Table of contents]
8
+ 1. my owl function
9
+ 2. smooth scroll
10
+ 3. custom input type number function
11
+ 4. custom input type select function
12
+ 5. email patern
13
+ 6. equalheight function
14
+ 7. pricing fixedtable function
15
+ 8. content to center banner section
16
+ 9. sticky header
17
+ 10. skew background width calculate function
18
+ 11. on screen function
19
+ 12. set logo function
20
+ 13. prelaoder load done then load wow
21
+ 14. preloader close button
22
+ 15. mega navigation menu init
23
+ 16. twitter api init
24
+ 17. client slider
25
+ 18. testimonial slider
26
+ 19. testimonial slider 2
27
+ 20. blog post gallery slider
28
+ 21. contact form init
29
+ 22. turn off autocomplete
30
+ 23. service block on hover class add
31
+ 24. video popup init
32
+ 25. Side Offset cart menu open
33
+ 26. wow animation init
34
+ 27. my custom select init
35
+ 28. tab swipe indicator
36
+ 29. pricing matrix expand slider
37
+ 30. feature section prev class get function
38
+ 31. pricing expand function
39
+ 32. accordion add class "isActive" function
40
+ 33. click and go to current section init
41
+ 34. input number increase
42
+ 35. right click , ctrl+u and ctrl+shift+i disabled
43
+ 36. image dragable false setup
44
+ 37. ajaxchimp init
45
+ 38. wave animation use by parallax
46
+ 39. magnific modal popup
47
+ 40. tooltip init
48
+ 41. revulation hero init
49
+ 42. revulation carousel slider init
50
+ 43. shuffle letters
51
+ 44. XpeedStudio Maps
52
+ -------------------------------------------------------------------*/
53
+
54
+ /*==========================================================
55
+ 1. my owl function
56
+ ======================================================================*/
57
+
58
+ $.fn.myOwl = function (options) {
59
+
60
+ var settings = $.extend({
61
+ items: 1,
62
+ dots: false,
63
+ loop: true,
64
+ mouseDrag: true,
65
+ touchDrag: true,
66
+ nav: false,
67
+ autoplay: true,
68
+ navText: ['', ''],
69
+ margin: 0,
70
+ stagePadding: 0,
71
+ autoplayTimeout: 5000,
72
+ autoplayHoverPause: true,
73
+ navRewind: false,
74
+ responsive: {},
75
+ animateOut: '',
76
+ animateIn: '',
77
+ smartSpeed: 900,
78
+ center: ''
79
+ }, options);
80
+
81
+ return this.owlCarousel({
82
+ items: settings.items,
83
+ loop: settings.loop,
84
+ mouseDrag: settings.mouseDrag,
85
+ touchDrag: settings.touchDrag,
86
+ nav: settings.nav,
87
+ navText: settings.navText,
88
+ dots: settings.dots,
89
+ margin: settings.margin,
90
+ stagePadding: settings.stagePadding,
91
+ autoplay: settings.autoplay,
92
+ autoplayTimeout: settings.autoplayTimeout,
93
+ autoplayHoverPause: settings.autoplayHoverPause,
94
+ animateOut: settings.animateOut,
95
+ animateIn: settings.animateIn,
96
+ responsive: settings.responsive,
97
+ navRewind: settings.navRewind,
98
+ center: settings.center,
99
+ smartSpeed: settings.smartSpeed
100
+ });
101
+ };
102
+
103
+ /*==========================================================
104
+ 2. smooth scroll
105
+ ======================================================================*/
106
+ $.fn.scrollView = function () {
107
+ return this.each(function () {
108
+ $('html, body').animate({
109
+ scrollTop: $(this).offset().top
110
+ }, 1000);
111
+ });
112
+ };
113
+
114
+ /*==========================================================
115
+ 3. custom input type number function
116
+ ======================================================================*/
117
+ $.fn.customNumber = function (options) {
118
+ var settings = $.extend({
119
+ plusIcon: '',
120
+ minusIcon: ''
121
+ }, options);
122
+
123
+ this.append('<span class="add">' + settings.plusIcon + '</span>');
124
+ this.append('<span class="sub">' + settings.minusIcon + '</span>');
125
+
126
+ return this.each(function () {
127
+ var spinner = $(this),
128
+ input = spinner.find('input[type="number"]'),
129
+ add = spinner.find('.add'),
130
+ sub = spinner.find('.sub');
131
+
132
+ input.parent().on('click', '.sub', function (event) {
133
+ event.preventDefault();
134
+ if (input.val() > parseInt(input.attr('min'), 10)) {
135
+ input.val(function (i, oldvalue) {
136
+ return --oldvalue;
137
+ });
138
+ }
139
+ });
140
+ input.parent().on('click', '.add', function (event) {
141
+ event.preventDefault();
142
+ if (input.val() < parseInt(input.attr('max'), 10)) {
143
+ input.val(function (i, oldvalue) {
144
+ return ++oldvalue;
145
+ });
146
+ }
147
+ });
148
+ });
149
+ };
150
+
151
+ /*==========================================================
152
+ 4. custom input type select function
153
+ ======================================================================*/
154
+ $.fn.mySelect = function (options) {
155
+ var $this = $(this),
156
+ numberOfOptions = $(this).children('option');
157
+
158
+ $this.addClass('select-hidden');
159
+ $this.wrap('<div class="select"></div>');
160
+ $this.after('<div class="select-styled"></div>');
161
+
162
+ var styledSelect = $this.next('.select-styled');
163
+ styledSelect.text($this.children('option').eq(0).text());
164
+
165
+ var list = $('<ul />', {
166
+ 'class': 'select-options'
167
+ }).insertAfter(styledSelect);
168
+
169
+ for (var i = 0; i < numberOfOptions.length; i++) {
170
+ $('<li />', {
171
+ text: $this.children('option').eq(i).text(),
172
+ rel: $this.children('option').eq(i).val()
173
+ }).appendTo(list);
174
+ }
175
+
176
+ var listItems = list.children('li');
177
+
178
+ styledSelect.on('click', function (e) {
179
+ e.stopPropagation();
180
+ $('.select-styled.active').not(this).each(function () {
181
+ $(this).removeClass('active').next('.select-options').fadeIn();
182
+ });
183
+ $(this).toggleClass('active').next('.select-options').toggle();
184
+ $(this).parent().toggleClass('focus');
185
+ });
186
+
187
+ listItems.on('click', function (e) {
188
+ e.stopPropagation();
189
+ styledSelect.text($(this).text()).removeClass('active');
190
+ $this.val($(this).attr('rel'));
191
+ list.hide();
192
+ if ($(this).parent().parent().hasClass('focus')) {
193
+ $(this).parent().parent().removeClass('focus');
194
+ }
195
+ });
196
+
197
+ $(document).on('click', function () {
198
+ styledSelect.removeClass('active');
199
+ list.hide();
200
+ });
201
+ };
202
+
203
+ /*==========================================================
204
+ 5. email patern
205
+ ======================================================================*/
206
+ function email_pattern(email) {
207
+ var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
208
+ return regex.test(email);
209
+ }
210
+
211
+ /*==========================================================
212
+ 6. equalheight function
213
+ ======================================================================*/
214
+ function equalHeight() {
215
+ var pricingImage = $('.pricing-image'),
216
+ pricingFeature = $('.pricing-feature-group');
217
+
218
+ if ($(window).width() > 991) {
219
+ pricingFeature.css('height', pricingImage.outerHeight());
220
+ } else {
221
+ pricingFeature.css('height', 100 + '%');
222
+ }
223
+ }
224
+
225
+ /*==========================================================
226
+ 7. pricing fixedtable function
227
+ ======================================================================*/
228
+ function fixedtabel() {
229
+
230
+ var table = $('.xs-table');
231
+
232
+ if (!($(window).width() > 576)) {
233
+ if ($('.xs-table.fixed-column').length === 0) {
234
+ var fixedCol = table.clone().insertBefore(table).addClass('fixed-column');
235
+ }
236
+ } else {
237
+ $('.xs-table.fixed-column').remove();
238
+ }
239
+ var fixedCol = $('.xs-table.fixed-column');
240
+ fixedCol.find('th:not(:first-child),td:not(:first-child)').remove();
241
+
242
+ fixedCol.find('tr').each(function (i, elem) {
243
+ $(this).height(table.find('tr:eq(' + i + ')').height());
244
+ });
245
+ };
246
+
247
+ /*==========================================================
248
+ 8. content to center banner section
249
+ ======================================================================*/
250
+ function centerContent() {
251
+ var content = $('.contet-to-center > .container'),
252
+ header = $('.header-transparent');
253
+
254
+ if ($(window).width() > 991) {
255
+ content.css('margin-top', header.outerHeight());
256
+ } else {
257
+ content.css('margin-top', 0 + 'px');
258
+ }
259
+ }
260
+
261
+ /*==========================================================
262
+ 9. sticky header
263
+ ======================================================================*/
264
+ function stickyHeader() {
265
+ var mainheader = $('.nav-sticky'),
266
+ height = mainheader.outerHeight(),
267
+ scroll = $(document).scrollTop();
268
+ $(window).on('load', function () {
269
+ if ($(document).scrollTop() > height) {
270
+ if (mainheader.hasClass('sticky-header')) {
271
+ mainheader.removeClass('sticky-header');
272
+ } else {
273
+ mainheader.addClass('sticky-header');
274
+ }
275
+ }
276
+ });
277
+ $(window).on('scroll', function () {
278
+ var scrolled = $(document).scrollTop(),
279
+ header = $('.sticky-header');
280
+ if (scrolled > scroll) {
281
+ header.addClass('sticky');
282
+ } else {
283
+ header.removeClass('sticky');
284
+ }
285
+ if (header.attr('data-scroll-position') === 'top') {
286
+ if (scrolled < scroll) {
287
+ header.addClass('sticky');
288
+ } else {
289
+ header.removeClass('sticky');
290
+ }
291
+ }
292
+ if (scrolled === 0) {
293
+ mainheader.removeClass('sticky-header');
294
+ } else {
295
+ mainheader.addClass('sticky-header');
296
+ }
297
+ scroll = $(document).scrollTop();
298
+ });
299
+ }
300
+
301
+ /*==========================================================
302
+ 10. skew background width calculate function
303
+ ======================================================================*/
304
+ function skewBgWidthCalc() {
305
+ var skewBg = $('.xs-banner.skew-bg'),
306
+ width = $(window).width();
307
+ skewBg.append('<style>.xs-banner.skew-bg::after{border-left: ' + width + 'px solid transparent}</style>');
308
+ }
309
+
310
+ /*==========================================================
311
+ 11. on screen function
312
+ ======================================================================*/
313
+ $.fn.onScreen = function () {
314
+ var offset = this.offset();
315
+ var win = $(window);
316
+ var viewport = {
317
+ top: $(window).scrollTop(),
318
+ left: $(window).scrollLeft()
319
+ };
320
+ viewport.right = viewport.left + $(window).width();
321
+ viewport.bottom = viewport.top + $(window).height();
322
+ offset.right = offset.left + this.outerWidth();
323
+ offset.bottom = offset.top + this.outerHeight();
324
+ return !(viewport.right < offset.left || viewport.left > offset.right || viewport.bottom < offset.top || viewport.top > offset.bottom);
325
+ };
326
+
327
+ /*==========================================================
328
+ 12. set logo function
329
+ ======================================================================*/
330
+ function setLogo() {
331
+ $('.xs-logo').each(function () {
332
+ var $this = $(this).children(),
333
+ clone = $this.clone(),
334
+ holder = $('.nav-brand');
335
+ if ($(window).width() > 991) {
336
+ if (holder.children().length > 0) {
337
+ holder.children().remove();
338
+ }
339
+ } else {
340
+ if (holder.children().length === 0) {
341
+ holder.append(clone);
342
+ }
343
+ }
344
+ });
345
+ }
346
+
347
+ $(window).on('load', function () {
348
+
349
+ // equal hight init
350
+ equalHeight();
351
+ // fixedtable init
352
+ fixedtabel();
353
+ // center content
354
+ centerContent();
355
+
356
+ // sticky header init
357
+ stickyHeader();
358
+
359
+ // set logo
360
+ setLogo();
361
+
362
+ /*==========================================================
363
+ 13. prelaoder load done then load wow
364
+ ======================================================================*/
365
+ setTimeout(function () {
366
+ $('#preloader').addClass('loaded', function () {
367
+ var wow = new WOW({
368
+ boxClass: 'wow',
369
+ animateClass: 'animated',
370
+ offset: 0,
371
+ mobile: false,
372
+ live: true,
373
+ scrollContainer: null
374
+ });
375
+ wow.init();
376
+ });
377
+ }, 1000);
378
+ }); // END load Function
379
+
380
+ $(document).ready(function () {
381
+ // equal hight init
382
+ equalHeight();
383
+ // fixedtable init
384
+ fixedtabel();
385
+ // center content
386
+ centerContent();
387
+
388
+ // sticky header init
389
+ stickyHeader();
390
+
391
+ // set logo
392
+ setLogo();
393
+
394
+ if ($('<style>.xs-banner.skew-bg::after</style>').length > 0) {
395
+ skewBgWidthCalc();
396
+ }
397
+
398
+ /*==========================================================
399
+ 14. preloader close button
400
+ ======================================================================*/
401
+ $('.prelaoder-btn').on('click', function (e) {
402
+ e.preventDefault();
403
+ if (!$('#preloader').hasClass('loaded')) {
404
+ $('#preloader').addClass('loaded');
405
+ }
406
+ });
407
+
408
+ /*==========================================================
409
+ 15. mega navigation menu init
410
+ ======================================================================*/
411
+ if ($('.xs-menus').length > 0) {
412
+ $('.xs-menus').xs_nav({
413
+ mobileBreakpoint: 992
414
+ });
415
+ }
416
+
417
+ /*==========================================================
418
+ 16. twitter api init
419
+ ======================================================================*/
420
+ if ($('.xs-tweet').length > 0) {
421
+ $('.xs-tweet').twittie({
422
+ dateFormat: '%b. %d, %Y',
423
+ template: '{{tweet}} <div class="date">{{date}}</div> <a href="{{url}}" target="_blank">Details</a>',
424
+ count: 2,
425
+ username: 'xpeedstudio',
426
+ loadingText: 'Loading!'
427
+ });
428
+ }
429
+
430
+ /*==========================================================
431
+ 17. client slider
432
+ ======================================================================*/
433
+ if ($('.xs-client-slider').length > 0) {
434
+ $('.xs-client-slider').myOwl({
435
+ items: 5,
436
+ responsive: {
437
+ 0: {
438
+ items: 1
439
+ },
440
+ 768: {
441
+ items: 3
442
+ },
443
+ 1024: {
444
+ items: 5
445
+ }
446
+ }
447
+ });
448
+ }
449
+
450
+ /*==========================================================
451
+ 18. testimonial slider
452
+ ======================================================================*/
453
+ if ($('.xs-testimonial-slider').length > 0) {
454
+ $('.xs-testimonial-slider').myOwl({
455
+ items: 3,
456
+ center: true,
457
+ animateOut: 'fadeOut',
458
+ animateIn: 'fadeIn',
459
+ responsive: {
460
+ 0: {
461
+ items: 1
462
+ },
463
+ 920: {
464
+ items: 1
465
+ // center: false
466
+ },
467
+ 1024: {
468
+ items: 3,
469
+ center: true
470
+ }
471
+ }
472
+ });
473
+ }
474
+
475
+ /*==========================================================
476
+ 19. testimonial slider 2
477
+ ======================================================================*/
478
+ if ($('.xs-testimonial-slider-2').length > 0) {
479
+ $('.xs-testimonial-slider-2').myOwl({
480
+ items: 3,
481
+ center: true,
482
+ animateOut: 'fadeOut',
483
+ animateIn: 'fadeIn',
484
+ dots: true,
485
+ responsive: {
486
+ 0: {
487
+ items: 1
488
+ },
489
+ 920: {
490
+ items: 1
491
+ // center: false
492
+ },
493
+ 1024: {
494
+ items: 3,
495
+ center: true
496
+ }
497
+ }
498
+ });
499
+ }
500
+
501
+ /*==========================================================
502
+ 20. blog post gallery slider
503
+ ======================================================================*/
504
+ if ($('.post-gallery-slider').length > 0) {
505
+ $('.post-gallery-slider').myOwl({
506
+ nav: true,
507
+ navText: ['<i class="icon icon-arrow-left"></i>', '<i class="icon icon-arrow-right"></i>'],
508
+ responsive: {
509
+ 0: {
510
+ nav: false
511
+ }
512
+ }
513
+ });
514
+ }
515
+
516
+ /*==========================================================
517
+ 21. contact form init
518
+ ======================================================================*/
519
+
520
+ $(document).on('submit', '#xs-contact-form', function (event) {
521
+ event.preventDefault();
522
+ /* Act on the event */
523
+
524
+ var xs_contact_name = $('#xs_contact_name'),
525
+ xs_contact_email = $('#xs_contact_email'),
526
+ xs_contact_website = $('#xs_contact_website'),
527
+ x_contact_massage = $('#x_contact_massage'),
528
+ xs_contact_submit = $('#xs_contact_submit'),
529
+ xs_contact_error = false;
530
+
531
+ $('.xpeedStudio_success_message').remove();
532
+
533
+ if (xs_contact_name.val().trim() === '') {
534
+ xs_contact_name.addClass('invaild');
535
+ xs_contact_error = true;
536
+ xs_contact_name.focus();
537
+ return false;
538
+ } else {
539
+ xs_contact_name.removeClass('invaild');
540
+ }
541
+ if (xs_contact_email.val().trim() === '') {
542
+ xs_contact_email.addClass('invaild');
543
+ xs_contact_error = true;
544
+ xs_contact_email.focus();
545
+ return false;
546
+ } else if (!email_pattern(xs_contact_email.val().toLowerCase())) {
547
+ xs_contact_email.addClass('invaild');
548
+ xs_contact_error = true;
549
+ xs_contact_email.focus();
550
+ return false;
551
+ } else {
552
+ xs_contact_email.removeClass('invaild');
553
+ }
554
+ if (xs_contact_website.val().trim() === '') {
555
+ xs_contact_website.addClass('invaild');
556
+ xs_contact_error = true;
557
+ xs_contact_website.focus();
558
+ return false;
559
+ } else {
560
+ xs_contact_website.removeClass('invaild');
561
+ }
562
+ if (x_contact_massage.val().trim() === '') {
563
+ x_contact_massage.addClass('invaild');
564
+ xs_contact_error = true;
565
+ x_contact_massage.focus();
566
+ return false;
567
+ } else {
568
+ x_contact_massage.removeClass('invaild');
569
+ }
570
+
571
+ if (xs_contact_error === false) {
572
+ xs_contact_submit.before().hide().fadeIn();
573
+ $.ajax({
574
+ type: "POST",
575
+ url: "assets/php/contact-form.php",
576
+ data: {
577
+ 'xs_contact_name': xs_contact_name.val(),
578
+ 'xs_contact_email': xs_contact_email.val(),
579
+ 'xs_contact_website': xs_contact_website.val(),
580
+ 'x_contact_massage': x_contact_massage.val()
581
+ },
582
+ success: function success(result) {
583
+ xs_contact_submit.after('<p class="xpeedStudio_success_message">' + result + '</p>').hide().fadeIn();
584
+
585
+ setTimeout(function () {
586
+ $(".xpeedStudio_success_message").fadeOut(1000, function () {
587
+ $(this).remove();
588
+ });
589
+ }, 5000);
590
+
591
+ $('#xs-contact-form')[0].reset();
592
+ }
593
+ });
594
+ }
595
+ });
596
+
597
+ /*==========================================================
598
+ 22. turn off autocomplete
599
+ ======================================================================*/
600
+ $('input').each(function (e) {
601
+ $(this).attr('autocomplete', 'off');
602
+ $(this).attr('autocorrect', 'off');
603
+ });
604
+
605
+ /*==========================================================
606
+ 23. service block on hover class add
607
+ ======================================================================*/
608
+ $('.xs-service-block').on('mouseenter', function () {
609
+ if (!$(this).hasClass('active')) {
610
+ $(this).addClass('active');
611
+ }
612
+ });
613
+ $('.xs-service-block').on('mouseleave', function (e) {
614
+ if ($(this).hasClass('active')) {
615
+ $(this).removeClass('active');
616
+ }
617
+ });
618
+
619
+ /*==========================================================
620
+ 24. video popup init
621
+ ======================================================================*/
622
+ if ($('.xs-video-popup').length > 0) {
623
+ $('.xs-video-popup').magnificPopup({
624
+ disableOn: 700,
625
+ type: 'iframe',
626
+ mainClass: 'mfp-fade',
627
+ removalDelay: 160,
628
+ preloader: false,
629
+ fixedContentPos: false
630
+ });
631
+ }
632
+
633
+ /*==========================================================
634
+ 25. Side Offset cart menu open
635
+ ======================================================================*/
636
+ if ($('.offset-side-bar').length > 0) {
637
+ $('.offset-side-bar').on('click', function (e) {
638
+ e.preventDefault();
639
+ e.stopPropagation();
640
+ $('.cart-group').addClass('isActive');
641
+ });
642
+ }
643
+ if ($('.close-side-widget').length > 0) {
644
+ $('.close-side-widget').on('click', function (e) {
645
+ e.preventDefault();
646
+ $('.cart-group').removeClass('isActive');
647
+ });
648
+ }
649
+ if ($('.navSidebar-button').length > 0) {
650
+ $('.navSidebar-button').on('click', function (e) {
651
+ e.preventDefault();
652
+ e.stopPropagation();
653
+ $('.info-group').addClass('isActive');
654
+ });
655
+ }
656
+ if ($('.close-side-widget').length > 0) {
657
+ $('.close-side-widget').on('click', function (e) {
658
+ e.preventDefault();
659
+ $('.info-group').removeClass('isActive');
660
+ });
661
+ }
662
+ $('body').on('click', function (e) {
663
+ $('.info-group').removeClass('isActive');
664
+ $('.cart-group').removeClass('isActive');
665
+ });
666
+ $('.xs-sidebar-widget').on('click', function (e) {
667
+ e.stopPropagation();
668
+ });
669
+
670
+ /*=============================================================
671
+ 26. wow animation init
672
+ =========================================================================*/
673
+ // $(function () {
674
+ // var wow = new WOW({
675
+ // boxClass: 'wow',
676
+ // animateClass: 'animated',
677
+ // offset: 0,
678
+ // mobile: false,
679
+ // live: true,
680
+ // scrollContainer: null,
681
+ // });
682
+ // wow.init();
683
+ // });
684
+
685
+ /*=============================================================
686
+ 27. my custom select init
687
+ =========================================================================*/
688
+ if ($('select').length > 0) {
689
+ $('select').mySelect();
690
+ }
691
+
692
+ /*=============================================================
693
+ 28. tab swipe indicator
694
+ =========================================================================*/
695
+ if ($('.tab-swipe').length > 0) {
696
+ $('.tab-swipe').each(function () {
697
+ $('.tab-swipe').append('<li class="indicator"></li>');
698
+ if ($('.tab-swipe li a').hasClass('active')) {
699
+ var cLeft = $('.tab-swipe li a.active').position().left + 'px',
700
+ cWidth = $('.tab-swipe li a.active').css('width');
701
+ $('.indicator').css({
702
+ left: cLeft,
703
+ width: cWidth
704
+ });
705
+ }
706
+ $('.tab-swipe li a').on('click', function () {
707
+ $('.tab-swipe li a').removeClass('isActive');
708
+ $(this).addClass('isActive');
709
+ var cLeft = $('.tab-swipe li a.isActive').position().left + 'px',
710
+ cWidth = $('.tab-swipe li a.isActive').css('width');
711
+ $('.indicator').css({
712
+ left: cLeft,
713
+ width: cWidth
714
+ });
715
+ });
716
+ });
717
+ }
718
+
719
+ /*=============================================================
720
+ 29. pricing matrix expand slider
721
+ =========================================================================*/
722
+ if ($('.pricing-matrix-slider').length > 0) {
723
+ $('.pricing-matrix-slider').on('initialized.owl.carousel translated.owl.carousel', function () {
724
+ var $this = $(this);
725
+ $this.find('.owl-item.last-child').each(function () {
726
+ $(this).removeClass('last-child');
727
+ });
728
+ $(this).find('.owl-item.active').last().addClass('last-child');
729
+ });
730
+ var sliderItems = $(this).find('.pricing-matrix-slider .pricing-matrix-item').length;
731
+ var slideControl = null;
732
+ if (sliderItems <= 3) {
733
+ slideControl = false;
734
+ } else if (sliderItems >= 4) {
735
+ slideControl = true;
736
+ } else {
737
+ return;
738
+ }
739
+ $('.pricing-matrix-slider').myOwl({
740
+ items: 3,
741
+ mouseDrag: slideControl,
742
+ autoplay: slideControl,
743
+ nav: true,
744
+ navText: ['<i class="icon icon-arrow-left"></i>', '<i class="icon icon-arrow-right"></i>'],
745
+ loop: false,
746
+ responsive: {
747
+ 0: {
748
+ items: 1,
749
+ mouseDrag: true,
750
+ loop: true
751
+ },
752
+ 768: {
753
+ items: 2,
754
+ mouseDrag: true
755
+ },
756
+ 1024: {
757
+ items: 3,
758
+ mouseDrag: slideControl,
759
+ autoplay: slideControl
760
+ }
761
+ }
762
+ });
763
+ }
764
+
765
+ /*=============================================================
766
+ 30. feature section prev class get function
767
+ =========================================================================*/
768
+ if ($('.xs-feature-section').length > 0) {
769
+ if ($('.xs-feature-section').prev().hasClass('xs-bg-gray')) {
770
+ $('.xs-feature-section').addClass('xs-bg-gray');
771
+ } else {
772
+ $('.xs-feature-section').removeClass('xs-bg-gray');
773
+ }
774
+ if ($('.xs-footer-section').prev().hasClass('xs-bg-gray')) {
775
+ $('.xs-footer-section').children('.xs-feature-section').addClass('xs-bg-gray');
776
+ } else {
777
+ $('.xs-footer-section').children('.xs-feature-section').removeClass('xs-bg-gray');
778
+ }
779
+ };
780
+
781
+ /*=============================================================
782
+ 31. pricing expand function
783
+ =========================================================================*/
784
+ if ($('.pricing-expand').length > 0) {
785
+ if ($(window).width() > 991) {
786
+ var pricingContainer = $('.pricing-expand.pricing-matrix'),
787
+ height = Math.floor(pricingContainer.height()),
788
+ children = $('.pricing-expand.pricing-matrix .pricing-matrix-slider'),
789
+ childreHeight = children.height(),
790
+ gap = $('.pricing-expand.pricing-matrix .gap'),
791
+ gapHeight = gap.height(),
792
+ mini = Math.floor(height - (childreHeight / 2 + gap.length * 1)),
793
+ animSpeed = 500;
794
+
795
+ pricingContainer.attr('data-height', height + 'px');
796
+ pricingContainer.attr('data-min', mini + 'px');
797
+ pricingContainer.css('height', mini + 'px');
798
+
799
+ if ($('.content-collapse-wraper').length === 0) {
800
+ pricingContainer.after('<div class="content-collapse-wraper"><a href="#" class="btn btn-primary expand-btn">Load More <i class="icon icon-arrow_down"></i></a></div>');
801
+ }
802
+
803
+ $('.expand-btn').on('click', function (e) {
804
+ e.preventDefault();
805
+ var content = $(this).parent().prev();
806
+ content.animate({
807
+ 'height': content.attr('data-height')
808
+ }, animSpeed);
809
+ content.addClass('expand');
810
+ $(this).addClass('hide');
811
+ });
812
+ } else {
813
+ if ($('.pricing-matrix').hasClass('pricing-expand')) {
814
+ $('.pricing-matrix').removeClass('pricing-expand');
815
+ console.log('hi');
816
+ } else {
817
+ $('.pricing-matrix').removeClass('pricing-expand');
818
+ }
819
+ }
820
+ }
821
+ $('.pricing-matrix .gap').prev().addClass('border-bottom-0');
822
+
823
+ /*=============================================================
824
+ 32. accordion add class "isActive" function
825
+ =========================================================================*/
826
+ if ($('.xs-accordion .card-header > a').length > 0) {
827
+ $('.xs-accordion .card-header > a').on('click', function () {
828
+ if (!$(this).parent().parent().hasClass('isActive')) {
829
+ $(this).parent().parent().prevAll().removeClass('isActive');
830
+ $(this).parent().parent().nextAll().removeClass('isActive');
831
+ $(this).parent().parent().addClass('isActive');
832
+ }
833
+ });
834
+ }
835
+
836
+ /*=============================================================
837
+ 33. click and go to current section init
838
+ =========================================================================*/
839
+ $('.comment-reply-link').on('click', function (event) {
840
+ event.preventDefault();
841
+ $('#comment-form').scrollView();
842
+ });
843
+
844
+ /*=============================================================
845
+ 34. input number increase
846
+ =========================================================================*/
847
+
848
+ $('.custom_number').customNumber({
849
+ plusIcon: '<i class="icon icon-plus"></i>',
850
+ minusIcon: '<i class="icon icon-minus"></i>'
851
+ });
852
+
853
+ /*=============================================================
854
+ 35. right click , ctrl+u and ctrl+shift+i disabled
855
+ =========================================================================*/
856
+ // $('body').on('contextmenu', function (e) {
857
+ // e.preventDefault();
858
+ // e.stopPropagation();
859
+ // return false;
860
+ // });
861
+ // $(document).on('keydown', function(e) {
862
+ // if (
863
+ // (e.ctrlKey && (e.keyCode == 85)) ||
864
+ // (e.ctrlKey && (e.shiftKey && e.keyCode == 73)) ||
865
+ // (e.ctrlKey && (e.shiftKey && e.keyCode == 75)) ||
866
+ // (e.metaKey && (e.shiftKey && e.keyCode == 91))
867
+ // ) {
868
+ // return false;
869
+ // } else {
870
+ // return true;
871
+ // }
872
+ // });
873
+
874
+ /*=============================================================
875
+ 36. image dragable false setup
876
+ =========================================================================*/
877
+ $('img').each(function () {
878
+ $(this).attr('draggable', 'false');
879
+ $(this).on('mousedown', function (event) {
880
+ if (event.preventDefault) {
881
+ event.preventDefault();
882
+ }
883
+ });
884
+ });
885
+
886
+ /*=============================================================
887
+ 37. ajaxchimp init
888
+ =========================================================================*/
889
+ if ($('#subscribe-form').length > 0) {
890
+ $('#subscribe-form').ajaxChimp({
891
+ url: 'https://facebook.us8.list-manage.com/subscribe/post?u=85f515a08b87483d03fee7755&amp;id=66389dc38b'
892
+ });
893
+ }
894
+
895
+ /*==========================================================
896
+ 38. wave animation use by parallax
897
+ ======================================================================*/
898
+ if ($('.wave_animation').length > 0) {
899
+ $('.wave_animation').parallax();
900
+ }
901
+
902
+ /*==========================================================
903
+ 39. magnific modal popup
904
+ ======================================================================*/
905
+ if ($('.xs-modal-popup').length > 0) {
906
+ $('.xs-modal-popup').magnificPopup({
907
+ type: 'inline',
908
+ fixedContentPos: false,
909
+ fixedBgPos: true,
910
+ overflowY: 'auto',
911
+ closeBtnInside: false,
912
+ callbacks: {
913
+ beforeOpen: function beforeOpen() {
914
+ this.st.mainClass = "my-mfp-slide-bottom xs-promo-popup";
915
+ }
916
+ }
917
+ });
918
+ }
919
+
920
+ /*==========================================================
921
+ 40. tooltip init
922
+ ======================================================================*/
923
+ $('[data-toggle="tooltip"]').tooltip();
924
+
925
+ /*==========================================================
926
+ 41. revulation hero init
927
+ ======================================================================*/
928
+ var revapi17, tpj;
929
+ (function () {
930
+ if (!/loaded|interactive|complete/.test(document.readyState)) document.addEventListener("DOMContentLoaded", onLoad);else onLoad();
931
+
932
+ function onLoad() {
933
+ if (tpj === undefined) {
934
+ tpj = jQuery;if ("off" == "on") tpj.noConflict();
935
+ }
936
+ if (tpj("#rev_slider_17_1").revolution == undefined) {
937
+ revslider_showDoubleJqueryError("#rev_slider_17_1");
938
+ } else {
939
+ revapi17 = tpj("#rev_slider_17_1").show().revolution({
940
+ sliderType: "hero",
941
+ jsFileLocation: "",
942
+ sliderLayout: "fullwidth",
943
+ dottedOverlay: "none",
944
+ delay: 9000,
945
+ navigation: {},
946
+ responsiveLevels: [1240, 1024, 778, 480],
947
+ visibilityLevels: [1240, 1024, 778, 480],
948
+ gridwidth: [1600, 1024, 778, 480],
949
+ gridheight: [1110, 768, 960, 720],
950
+ lazyType: "none",
951
+ parallax: {
952
+ type: "mouse",
953
+ origo: "enterpoint",
954
+ speed: 400,
955
+ speedbg: 0,
956
+ speedls: 0,
957
+ levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 46, 47, 48, 49, 50, 51, 55],
958
+ disable_onmobile: "on"
959
+ },
960
+ shadow: 0,
961
+ spinner: "spinner0",
962
+ autoHeight: "off",
963
+ disableProgressBar: "on",
964
+ hideThumbsOnMobile: "off",
965
+ hideSliderAtLimit: 0,
966
+ hideCaptionAtLimit: 0,
967
+ hideAllCaptionAtLilmit: 0,
968
+ debugMode: false,
969
+ fallbacks: {
970
+ simplifyAll: "off",
971
+ disableFocusListener: false
972
+ }
973
+ });
974
+ }; /* END OF revapi call */
975
+ }; /* END OF ON LOAD FUNCTION */
976
+ })(); /* END OF WRAPPING FUNCTION */
977
+
978
+ /*==========================================================
979
+ 42. revulation carousel slider init
980
+ ======================================================================*/
981
+ var revapi18, tpj;
982
+ (function () {
983
+ if (!/loaded|interactive|complete/.test(document.readyState)) document.addEventListener("DOMContentLoaded", onLoad);else onLoad();
984
+
985
+ function onLoad() {
986
+ if (tpj === undefined) {
987
+ tpj = jQuery;if ("off" == "on") tpj.noConflict();
988
+ }
989
+ if (tpj("#rev_slider_18_1").revolution == undefined) {
990
+ revslider_showDoubleJqueryError("#rev_slider_18_1");
991
+ } else {
992
+ revapi18 = tpj("#rev_slider_18_1").show().revolution({
993
+ sliderType: "standard",
994
+ jsFileLocation: "",
995
+ sliderLayout: "auto",
996
+ dottedOverlay: "none",
997
+ delay: 9000,
998
+ navigation: {
999
+ keyboardNavigation: "off",
1000
+ keyboard_direction: "horizontal",
1001
+ mouseScrollNavigation: "off",
1002
+ mouseScrollReverse: "default",
1003
+ onHoverStop: "off",
1004
+ touch: {
1005
+ touchenabled: "on",
1006
+ touchOnDesktop: "on",
1007
+ swipe_threshold: 75,
1008
+ swipe_min_touches: 1,
1009
+ swipe_direction: "horizontal",
1010
+ drag_block_vertical: false
1011
+ }
1012
+ },
1013
+ responsiveLevels: [1240, 1024, 778, 480],
1014
+ visibilityLevels: [1240, 1024, 778, 480],
1015
+ gridwidth: [1240, 1024, 778, 480],
1016
+ gridheight: [803, 768, 960, 720],
1017
+ lazyType: "none",
1018
+ shadow: 0,
1019
+ spinner: "spinner0",
1020
+ stopLoop: "off",
1021
+ stopAfterLoops: -1,
1022
+ stopAtSlide: -1,
1023
+ shuffle: "on",
1024
+ autoHeight: "off",
1025
+ disableProgressBar: "on",
1026
+ hideThumbsOnMobile: "off",
1027
+ hideSliderAtLimit: 0,
1028
+ hideCaptionAtLimit: 0,
1029
+ hideAllCaptionAtLilmit: 0,
1030
+ debugMode: false,
1031
+ fallbacks: {
1032
+ simplifyAll: "off",
1033
+ nextSlideOnWindowFocus: "off",
1034
+ disableFocusListener: false
1035
+ }
1036
+ });
1037
+ }; /* END OF revapi call */
1038
+ }; /* END OF ON LOAD FUNCTION */
1039
+ })(); /* END OF WRAPPING FUNCTION */
1040
+ }); // end ready function
1041
+
1042
+ $(window).on('scroll', function () {
1043
+ /*==========================================================
1044
+ 43. shuffle letters
1045
+ ======================================================================*/
1046
+ $('.shuffle-letter-title-wraper').each(function (e) {
1047
+ if ($(this).onScreen() && !$(this).hasClass('shuffle-title')) {
1048
+ setTimeout(function () {
1049
+ $(this).find('.shuufle-letter-title').shuffleLetters();
1050
+ $(this).addClass('shuffle-title');
1051
+ }.bind(this), 400);
1052
+ }
1053
+ });
1054
+ }); // END Scroll Function
1055
+
1056
+ $(window).on('resize', function () {
1057
+ // equal hight init
1058
+ equalHeight();
1059
+ // fixedtable init
1060
+ fixedtabel();
1061
+ // center content
1062
+ centerContent();
1063
+
1064
+ // set logo
1065
+ setLogo();
1066
+
1067
+ if ($('<style>.xs-banner.skew-bg::after</style>').length > 0) {
1068
+ skewBgWidthCalc();
1069
+ }
1070
+ }); // End Resize
1071
+
1072
+ /*==========================================================
1073
+ 44. XpeedStudio Maps
1074
+ ======================================================================*/
1075
+
1076
+ if ($('#xs-map').length > 0) {
1077
+ var locations = [['Bondi Beach', -33.890542, 151.274856, 4, 'assets/images/map-marker.png'], ['Coogee Beach', -33.923036, 151.259052, 5, 'assets/images/map-marker-1.png'], ['Cronulla Beach', -34.028249, 151.157507, 6, 'assets/images/map-marker-2.png']];
1078
+
1079
+ var map = new google.maps.Map(document.getElementById('xs-map'), {
1080
+ zoom: 10,
1081
+ center: new google.maps.LatLng(-33.92, 151.25),
1082
+ mapTypeId: google.maps.MapTypeId.ROADMAP,
1083
+ styles: [{ "featureType": "all", "elementType": "all", "stylers": [{ "hue": "#008eff" }] }, { "featureType": "poi", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "road", "elementType": "all", "stylers": [{ "saturation": "0" }, { "lightness": "0" }] }, { "featureType": "transit", "elementType": "all", "stylers": [{ "visibility": "off" }] }, { "featureType": "water", "elementType": "all", "stylers": [{ "visibility": "simplified" }, { "saturation": "-60" }, { "lightness": "-20" }] }]
1084
+ });
1085
+
1086
+ var infowindow = new google.maps.InfoWindow();
1087
+
1088
+ var marker, i;
1089
+
1090
+ for (i = 0; i < locations.length; i++) {
1091
+ marker = new google.maps.Marker({
1092
+ position: new google.maps.LatLng(locations[i][1], locations[i][2]),
1093
+ map: map,
1094
+ title: 'HostNinza',
1095
+ icon: locations[i][4]
1096
+ });
1097
+
1098
+ google.maps.event.addListener(marker, 'click', function (marker, i) {
1099
+ return function () {
1100
+ infowindow.setContent(locations[i][0]);
1101
+ infowindow.open(map, marker);
1102
+ };
1103
+ }(marker, i));
1104
+ }
1105
+ }
1106
+ })(jQuery);