(function($) {
"use strict";
// Document ready function
$(function() {
/* Fixing for hover effect at IOS */
$('*').on('touchstart', function() {
$(this).trigger('hover');
}).on('touchend', function() {
$(this).trigger('hover');
});
$(window).on('load', function () {
$('#preloader-active').delay(450).fadeOut('slow');
$('body').delay(450).css({
'overflow': 'visible'
});
});
var priceSlider = document.getElementById('price-range-filter');
if (priceSlider) {
noUiSlider.create(priceSlider, {
start: [20, 80],
connect: true,
/*tooltips: true,*/
range: {
'min': 0,
'max': 100
},
format: wNumb({
decimals: 0
}),
});
var marginMin = document.getElementById('price-range-min'),
marginMax = document.getElementById('price-range-max');
priceSlider.noUiSlider.on('update', function(values, handle) {
if (handle) {
marginMax.innerHTML = "$" + values[handle];
} else {
marginMin.innerHTML = "$" + values[handle];
}
});
}
if ($('.gallery-wrapper, #gallery-wrapper').length) {
$('.gallery-wrapper, #gallery-wrapper').magnificPopup({
type: 'image',
delegate: 'a.zoom',
gallery: {
enabled: true
}
});
}
/*-------------------------------------
Popup
-------------------------------------*/
if ($(".popup-youtube").length) {
$('.popup-youtube').magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
}
/*-------------------------------------
On click loadmore functionality
-------------------------------------*/
$('.loadmore').on('click', 'a', function(e) {
e.preventDefault();
var _this = $(this),
_parent = _this.parents('.courses-list-wrapper'),
_target = _parent.find('.courses-list'),
_set = _target.find('.courses-item.hidden').slice(0, 2); // Here 2 is the limit
if (_set.length) {
_set.animate({ opacity: 0 });
_set.promise().done(function() {
_set.removeClass('hidden');
_set.show().animate({ opacity: 1 }, 1000);
});
} else {
_this.text('No more item to display');
}
return false;
});
/*-------------------------------------
Input Quantity Up & Down activation code
-------------------------------------*/
$('#quantity-holder,#quantity-holder2').on('click', '.quantity-plus', function() {
var $holder = $(this).parents('.quantity-holder');
var $target = $holder.find('input.quantity-input');
var $quantity = parseInt($target.val(), 10);
if ($.isNumeric($quantity) && $quantity > 0) {
$quantity = $quantity + 1;
$target.val($quantity);
} else {
$target.val($quantity);
}
}).on('click', '.quantity-minus', function() {
var $holder = $(this).parents('.quantity-holder');
var $target = $holder.find('input.quantity-input');
var $quantity = parseInt($target.val(), 10);
if ($.isNumeric($quantity) && $quantity >= 2) {
$quantity = $quantity - 1;
$target.val($quantity);
} else {
$target.val(1);
}
});
/*-------------------------------------
Jquery Serch Box
-------------------------------------*/
$(document).on('click', '#search-button', function(e) {
e.preventDefault();
var targrt = $(this).prev('.search-form');
targrt.animate({
width: ["toggle", "swing"],
height: ["toggle", "swing"],
opacity: "toggle"
}, 500, "linear");
return false;
});
});
/*-------------------------------------
jQuery MeanMenu activation code
--------------------------------------*/
$('nav#dropdown').meanmenu({ siteLogo: "
" });
/*-------------------------------------
Wow js Active
-------------------------------------*/
new WOW().init();
/*-------------------------------------
Jquery Scollup
-------------------------------------*/
// $.scrollUp({
// scrollText: '',
// easingType: 'linear',
// scrollSpeed: 900,
// animation: 'fade',
// });
/*-------------------------------------
Window load function
-------------------------------------*/
$(window).on('load', function() {
// Page Preloader
$('#preloader').fadeOut('slow', function() {
$(this).remove();
});
/*-------------------------------------
jQuery for Isotope initialization
-------------------------------------*/
var $container = $('#inner-isotope');
if ($container.length > 0) {
var $filterTab = $container.find('.isotop-classes-tab, .filter-tabs');
if ($filterTab.length > 0) {
var selector = $filterTab.find('a.current').attr('data-filter');
// Isotope initialization
var $isotope = $container.find('.featuredContainer').isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
// Isotope filter
$filterTab.on('click', 'a', function() {
var $this = $(this);
$filterTab.find('a').removeClass('current');
$this.addClass('current');
var selector = $this.attr('data-filter');
$isotope.isotope({
filter: selector,
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}
});
return false;
});
}
}
}); // end window load function
/*-------------------------------------
About Counter
-------------------------------------*/
var aboutContainer = $('.about-counter');
if (aboutContainer.length) {
aboutContainer.counterUp({
delay: 50,
time: 5000
});
}
/*-------------------------------------
Select2 activation code
-------------------------------------*/
if ($('#checkout-form select.select2').length) {
$('#checkout-form select.select2').select2({
theme: 'classic',
dropdownAutoWidth: true,
width: '100%'
});
}
// Gridrotator
var riGrid = $('#ri-grid');
if (riGrid.length) {
riGrid.gridrotator({
rows: 3,
columns: 14,
animType: 'random',
animSpeed: 1000,
interval: 600,
step: 1,
w1024: {
rows: 3,
columns: 8
},
w768: {
rows: 3,
columns: 6
},
w480: {
rows: 3,
columns: 4
},
w320: {
rows: 3,
columns: 4
},
w240: {
rows: 3,
columns: 4
}
});
}
/*-------------------------------------
Contact Form processing
-------------------------------------*/
var contactForm = $('#contact-form');
if (contactForm.length) {
contactForm.validator().on('submit', function(e) {
var _this = $(this),
target = contactForm.find('.form-response');
if (e.isDefaultPrevented()) {
target.html("
Please select all required field.
Loading ...
Message has been sent successfully.
" + text + "
Please select all required field.
Loading ...
Successfully Send.
" + text + "
Day%!D
Hour%!H
Minute%!M
Second%!S
Dias
Horas
Minutos
Segundos