-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactive.js
119 lines (99 loc) · 3.16 KB
/
active.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
(function ($) {
'use strict';
var $window = $(window);
// :: 1.0 Masonary Gallery Active Code
var proCata = $('.amado-pro-catagory');
var singleProCata = ".single-products-catagory";
if ($.fn.imagesLoaded) {
proCata.imagesLoaded(function () {
proCata.isotope({
itemSelector: singleProCata,
percentPosition: true,
masonry: {
columnWidth: singleProCata
}
});
});
}
// :: 2.1 Search Active Code
var amadoSearch = $('.search-nav');
var searchClose = $('.search-close');
amadoSearch.on('click', function () {
$('body').toggleClass('search-wrapper-on');
});
searchClose.on('click', function () {
$('body').removeClass('search-wrapper-on');
});
// :: 2.2 Mobile Nav Active Code
var amadoMobNav = $('.amado-navbar-toggler');
var navClose = $('.nav-close');
amadoMobNav.on('click', function () {
$('.header-area').toggleClass('bp-xs-on');
});
navClose.on('click', function () {
$('.header-area').removeClass('bp-xs-on');
});
// :: 3.0 ScrollUp Active Code
if ($.fn.scrollUp) {
$.scrollUp({
scrollSpeed: 1000,
easingType: 'easeInOutQuart',
scrollText: '<i class="fa fa-angle-up" aria-hidden="true"></i>'
});
}
// :: 4.0 Sticky Active Code
$window.on('scroll', function () {
if ($window.scrollTop() > 0) {
$('.header_area').addClass('sticky');
} else {
$('.header_area').removeClass('sticky');
}
});
// :: 5.0 Nice Select Active Code
if ($.fn.niceSelect) {
$('select').niceSelect();
}
// :: 6.0 Magnific Active Code
if ($.fn.magnificPopup) {
$('.gallery_img').magnificPopup({
type: 'image'
});
}
// :: 7.0 Nicescroll Active Code
if ($.fn.niceScroll) {
$(".cart-table table").niceScroll();
}
// :: 8.0 wow Active Code
if ($window.width() > 767) {
new WOW().init();
}
// :: 9.0 Tooltip Active Code
if ($.fn.tooltip) {
$('[data-toggle="tooltip"]').tooltip();
}
// :: 10.0 PreventDefault a Click
$("a[href='#']").on('click', function ($) {
$.preventDefault();
});
// :: 11.0 Slider Range Price Active Code
$('.slider-range-price').each(function () {
var min = jQuery(this).data('min');
var max = jQuery(this).data('max');
var unit = jQuery(this).data('unit');
var value_min = jQuery(this).data('value-min');
var value_max = jQuery(this).data('value-max');
var label_result = jQuery(this).data('label-result');
var t = $(this);
$(this).slider({
range: true,
min: min,
max: max,
values: [value_min, value_max],
slide: function (event, ui) {
var result = label_result + " " + unit + ui.values[0] + ' - ' + unit + ui.values[1];
console.log(t);
t.closest('.slider-range').find('.range-price').html(result);
}
});
});
})(jQuery);