File: /home/emblazeone/public_html/smilz/js/script.js
$(document).ready(function () {
$('.owl-carousel').owlCarousel({
mouseDrag: true,
touchDrag: true,
loop: true,
dots: true,
center: true,
responsive: {
0: {
items: 1,
},
}
});
$('.button-menu').click(function () {
$('.nav-menu').addClass('open-menu');
$('body').addClass('locked');
$('.header-info').addClass('hide_up')
});
$('.drop_1').click(function () {
$('.register-wrapper').addClass('open-register');
$('body').addClass('locked');
$('.header-info').addClass('hide_up')
});
$('.drop_2').click(function () {
$('.login-wrapper').addClass('open-login');
$('body').addClass('locked');
$('.header-info').addClass('hide_up')
});
$('.search-icon').click(
function () {
$('.search-form').slideDown(500);
$('body').addClass('locked');
$('.header-info').addClass('hide_up')
})
$('.btn-exit__search').click(
function () {
$('.search-form').slideUp(500);
$('.header-info').removeClass('hide_up')
})
$('.btn-exit-menu').click(function () {
$('body').removeClass('locked');
$('.nav-menu').removeClass('open-menu');
$('.register-wrapper').removeClass('open-register');
$('.login-wrapper').removeClass('open-login');
$('.header-info').removeClass('hide_up')
});
$('.header-info__exit').click(function () {
$('.header-info').slideUp(500);
})
/*
$('.profile-menu-btn').click(
function () {
if (!$('.profile-menu-btn').hasClass('nav__menu_open')) {
$('.profile-menu-btn').toggleClass('nav__menu_open');
$('.profile-nav__menu').slideDown();
} else {
$('.profile-menu-btn').removeClass('nav__menu_open');
$('.profile-nav__menu').slideUp();
}
}
)
*/
//profile change class
$(".profile-nav ul li").click(function(e) {
e.preventDefault();
$(".profile-nav ul li").removeClass('active');
$(this).addClass('active');
})
// This button will increment the value
$('[data-quantity="plus"]').click(function (e) {
// Stop acting like a button
e.preventDefault();
// Get the field name
fieldName = $(this).attr('data-field');
// Get its current value
var currentVal = parseInt($('input[name=' + fieldName + ']').val());
// If is not undefined
if (!isNaN(currentVal)) {
// Increment
$('input[name=' + fieldName + ']').val(currentVal + 1);
} else {
// Otherwise put a 0 there
$('input[name=' + fieldName + ']').val(0);
}
});
// This button will decrement the value till 0
$('[data-quantity="minus"]').click(function (e) {
// Stop acting like a button
e.preventDefault();
// Get the field name
fieldName = $(this).attr('data-field');
// Get its current value
var currentVal = parseInt($('input[name=' + fieldName + ']').val());
// If it isn't undefined or its greater than 0
if (!isNaN(currentVal) && currentVal > 0) {
// Decrement one
$('input[name=' + fieldName + ']').val(currentVal - 1);
} else {
// Otherwise put a 0 there
$('input[name=' + fieldName + ']').val(0);
}
});
});