$(document).ready(function () { initSubMenus(); numberOnly(); initSelects(); initOwlCarousel(); }); function showToast(title, content) { iziToast.show({ title: title, message: content, buttons: [ ] }); } function showAlert(title, content, type) { swal({ title: title, text: content, type: type }); } function getIntValue(formatedValue) { var intVal = formatedValue.replaceAll("$", ""); intVal = intVal.replaceAll(",", ""); intVal = intVal.replaceAll(" ", ""); return parseInt(intVal); } function currencyFormat(num) { return '$' + num.toFixed(0).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,'); } function initSubMenus() { $('.horizontalSubMenu').mouseenter(function () { var _target = $(this).attr('menu-target'); $('#shopSubMenu').show(); }); $('#shopSubMenu').mouseleave(function () { $(this).hide(); }); } function numberOnly() { $('.numberonly').keypress(function (e) { var charCode = (e.which) ? e.which : event.keyCode if (String.fromCharCode(charCode).match(/[^0-9]/g)) return false; }); } function initSelects() { $(".select2").select2(); $('.select-shoing').niceSelect(); } function initOwlCarousel() { $(".owl-carousel").owlCarousel({ loop:true, autoplay: false, autoplayTimeout: 1000, autoplayHoverPause: false, responsive: { 0: { items: 2 }, 600: { items: 3 }, 1000: { items: 6 } }, nav : true, navText: ["
", ""] }); }