jQuery(document).ready(function($){ if(jQuery().tooltip) { jQuery(function () { jQuery('[data-toggle="tooltip"]').tooltip({ 'delay': { show: 0, hide: 300 } }); }); } if(jQuery('body').hasClass('page-template-page-welcome')) { ScrollReveal().reveal('.dom-master-landing-brand-button'); } else if(jQuery('body').hasClass('home') && jQuery('#al-master-intro').length) { jQuery('html, body').scrollTop(0); //jQuery(window).scrollTop(0); jQuery('body').css('overflow', 'hidden'); jQuery("#al-master-alien-btn").click(function(e){ e.preventDefault(); jQuery('#al-master-intro').addClass('fadeOutRight'); setTimeout(function(){ jQuery('#al-master-intro').remove(); }, 700); jQuery('body').css('overflow', 'auto'); }); } jQuery(document).on('click', '[data-toggle="lightbox"]', function(event) { event.preventDefault(); jQuery(this).ekkoLightbox({ onShown: function() { jQuery('.ekko-lightbox-container').append(''); }, }); }); setImageOpacity(); jQuery("#dominus_faqs button").click(function(){ jQuery('#dominus_faqs button i').each(function(){ jQuery(this).removeClass('icon-minus').addClass('icon-plus'); }); jQuery(this).children('i').removeClass('icon-plus').addClass('icon-minus'); }); if(jQuery('body').hasClass('single-dom_products')) { jQuery('#dom-product-gallery-thumbs').data('ck', 1); jQuery('#dominus_main_notifier').removeClass('dom-positive-color-bg').addClass('dom-primary-color-bg'); jQuery('#dom-product-gallery-thumbs > .dom-product-gallery-item > a:not(.dom-play-prod-video)').click(function(event) { event.preventDefault(); if(! jQuery('#dom-single-img-ppal').is(':visible')){ jQuery('#dom-single-video-ppal').slideUp(); jQuery('#dom-single-img-ppal').slideDown(); } $ck = jQuery('#dom-product-gallery-thumbs').data('ck'); product_ID = jQuery('#dom_single_prod_cont').data('prod_id'); color_img_url = jQuery(this).children('div').data('imgurl'); color_srcset = jQuery(this).children('div').data('srcset'); if($ck >= 1 && jQuery('#dom_single_prod_cont').data('prod_id') != 303) { if(color_img_url) { jQuery('#dom-product-main-photo img').fadeOut(); jQuery('#dom-product-main-photo img').attr("src", color_img_url); jQuery('#dom-product-main-photo img').attr("srcset", color_srcset); jQuery('#dom-product-main-photo').attr("href", color_img_url); jQuery('#dom-product-main-photo img').fadeIn(); } jQuery('#dom-product-gallery-thumbs > .dom-product-gallery-item > a').each(function() { jQuery(this).removeClass('selected'); }); jQuery(this).toggleClass('selected'); jQuery('#dom-product-gallery-thumbs').data('ck', $ck+1); } else if($ck <= 3 && jQuery('#dom_single_prod_cont').data('prod_id') == 303) { if(color_img_url) { jQuery('#dom-product-main-photo img').fadeOut(); jQuery('#dom-product-main-photo img').attr("src", color_img_url); jQuery('#dom-product-main-photo img').attr("srcset", color_srcset); jQuery('#dom-product-main-photo').attr("href", color_img_url); jQuery('#dom-product-main-photo img').fadeIn(); } jQuery(this).toggleClass('selected'); jQuery('.dominus_ajax_cart_product_color_1, .dominus_ajax_cart_product_color_2, .dominus_ajax_cart_product_color_3').val(''); jQuery('#dom-product-gallery-thumbs > .dom-product-gallery-item > .selected').each(function(index){ color = jQuery(this).children('div').data('color_1'); if(color) { jQuery('.dominus_ajax_cart_product_color_'+(index+1)).val(dom_hk_translate_color_code(color)); } }); jQuery('#dom-product-gallery-thumbs').data('ck', $ck+1); console.log($ck); } else if(jQuery(this).hasClass('selected')) { jQuery(this).removeClass('selected'); $ck = $ck-2; console.log($ck); jQuery('#dom-product-gallery-thumbs').data('ck', $ck); } jQuery("#hk_cust_float_btn").tooltip('show'); setTimeout(function(){ jQuery("#hk_cust_float_btn").tooltip('hide'); }, 4000); setTimeout(function() { jQuery('#dom-product-main-photo img').removeClass('fadeIn'); }, 500); jQuery('.dom_sel_prod_img_id').each(function() { jQuery(this).attr('value', jQuery('#dom-product-gallery-thumbs > .dom-product-gallery-item > .selected').data('imgid')); }); jQuery('#dom-product-main-photo > img').extmImageUpdate(color_img_url); }); for (i = 0; i < 6; i++) { color = jQuery('#dom-product-main-photo img').data('color_'+i); if(color) { jQuery('.dominus_ajax_cart_product_color_'+i).val(dom_hk_translate_color_code(color)); } }; jQuery('#dom-product-main-photo > img').extm({ zoomLevel: 2, lazy: true, position: 'overlay', }); } if(jQuery('body').hasClass('page-template-page-cart')) { jQuery('#dom_proceed_to_check_out').removeClass('btn-lg dom-cta-color-bg dom-black-bg-h dom-white-color rounded').addClass('button-alien btn-sm rounded-0 dom-primary-font dom-black-color-h text-uppercase'); }; //Guia de tallas var t_def = false; jQuery('.guia-range').on("input change", function() { var medida = jQuery(this).val(); var id = jQuery(this).attr('id'); jQuery('#'+id+'_live').text(medida+'cm'); var t_def = true; }); jQuery('#al-guia-ctrl-pr').click(function(){ current_sc = jQuery('.al-guia-ctrl-sc').data('sc'); jQuery('#al-talla-sc-'+current_sc).removeClass('d-block').fadeOut(); jQuery('#al-talla-sc-'+(current_sc-1)).removeClass('d-none').hide().addClass('d-block').fadeIn(); jQuery('.al-guia-ctrl-sc').data('sc', (current_sc-1)); if(current_sc <= 4) { jQuery(".al-guia-ctrl-sc").fadeIn(); } jQuery('#al-guia-current-step span').text(jQuery('.al-guia-ctrl-sc').data('sc')); }); jQuery(".al-guia-ctrl-sc").click(function(){ current_sc = jQuery(this).data('sc'); jQuery('#al-talla-sc-'+current_sc).removeClass('d-block').fadeOut(); jQuery('#al-talla-sc-'+(current_sc+1)).removeClass('d-none').hide().addClass('d-block').fadeIn(); current_sc = jQuery(this).data('sc', (current_sc+1)); jQuery('#al-guia-current-step span').text(jQuery(this).data('sc')); if(jQuery(this).data('sc') == 2) { jQuery('#al-guia-ctrl-pr').fadeIn(); } if(jQuery(this).data('sc') == 4) { jQuery(".al-guia-ctrl-sc").fadeOut(); cintura = jQuery('#m_cintura').val(); cadera = jQuery('#m_cadera').val(); if(t_def) { jQuery('#al-guia-error').addClass('d-none'); jQuery('#al-guia-t-sug-title, #al-guia-t-sug').removeClass('d-none'); if(cintura >= 64 && cintura <= 68 && cadera >= 93 && cadera <= 96) { jQuery('#al-guia-t-sug').text('6'); } if(cintura >= 68 && cintura <= 72 && cadera >= 97 && cadera <= 100) { jQuery('#al-guia-t-sug').text('8'); } if(cintura >= 72 && cintura <= 76 && cadera >= 101 && cadera <= 104) { jQuery('#al-guia-t-sug').text('10'); } if(cintura >= 76 && cintura <= 80 && cadera >= 105 && cadera <= 108) { jQuery('#al-guia-t-sug').text('12'); } if(cintura >= 80 && cintura <= 84 && cadera >= 109 && cadera <= 112) { jQuery('#al-guia-t-sug').text('14'); } if(cintura >= 84 && cintura <= 88 && cadera >= 113 && cadera <= 116) { jQuery('#al-guia-t-sug').text('16'); } } if(jQuery('#al-guia-jean-size').val() && ! t_def) { jQuery('#al-guia-t-sug').text(jQuery('#al-guia-jean-size').val()); jQuery('#al-guia-error').addClass('d-none'); jQuery('#al-guia-t-sug-title, #al-guia-t-sug').removeClass('d-none'); } if(jQuery('#al-guia-belly-size').val() == 1 || jQuery('#al-guia-belly-size') == 2) { jQuery('#al-guia-f-baggy, #al-guia-f-skinny').removeClass('d-none'); } if(jQuery('#al-guia-belly-size').val() == 3) { jQuery('#al-guia-f-baggy, #al-guia-f-skinny').removeClass('d-inline-block').addClass('d-none'); } if(jQuery('#al-guia-jean-type').val() == 'suelto' || jQuery('#al-guia-jean-type').val() == 'normal') { jQuery('#al-guia-f-baggy, #al-guia-f-momfit, #al-guia-f-cargo').removeClass('d-none').addClass('d-inline-block'); } if(jQuery('#al-guia-jean-type').val() == 'ajustado') { jQuery('#al-guia-f-baggy, #al-guia-f-momfit, #al-guia-f-cargo').addClass('d-none').removeClass('d-inline-block'); } } }); jQuery("div#guia_tallas .al-tallas-img-sel").click(function(){ var sel_belly_size = jQuery(this).data('belly'); jQuery('div#guia_tallas .al-tallas-img-sel').each(function() { jQuery(this).removeClass('al-tallas-img-selected'); }); jQuery(this).addClass('al-tallas-img-selected'); jQuery('#al-guia-belly-size').val(sel_belly_size); }); jQuery('.al-guia-btn').click(function(){ jQuery(this).closest('.col-12').children('.al-guia-btn').each(function() { jQuery(this).removeClass('dom-link-color-bg'); }); jQuery(this).addClass('dom-link-color-bg'); if(jQuery(this).data('jeantype')) { jQuery('#al-guia-jean-type').val(jQuery(this).data('jeantype')); } if(jQuery(this).data('jeansize')) { jQuery('#al-guia-jean-size').val(jQuery(this).data('jeansize')); } }); //Tallas - End jQuery('.navbarPrincipal .dropdown-toggle').hover(function() { //jQuery(this).next().stop(true, true).delay(100).addClass('show'); jQuery(this).next().css('opacity', 0).slideDown(50, function(){ jQuery(this).addClass('show'); }).animate({ opacity: 1 }, { queue: false, duration: 40 }); }, function() { //jQuery(this).next().stop(true, true).delay(200).fadeOut(200); }); jQuery('.navbarPrincipal .dropdown-menu').hover(function() { }, function() { //jQuery(this).stop(true, true).delay(400).removeClass('show'); jQuery(this).delay(400).css('opacity', 1).slideUp(50, function(){ jQuery(this).removeClass('show'); }).animate({ opacity: 0 }, { queue: false, duration: 50 }); }); jQuery('.navbarPrincipal > ul > li > a:not(.dropdown-toggle)').hover(function() { jQuery('.navbarPrincipal .dropdown-menu').css('opacity', 1).slideUp(300, function(){ jQuery('.navbarPrincipal .dropdown-menu').removeClass('show'); }).animate({ opacity: 0 }, { queue: false, duration: 100 }); }, function() { }); setTimeout(function(){ jQuery("#dom_float_wpp").tooltip('show'); }, 3000); setTimeout(function(){ jQuery("#dom_float_wpp").tooltip('hide'); }, 20000); if(jQuery().popover) { jQuery('.al-megamenu a').popover({ trigger: 'hover', offset: '0 0', customClass: 'al-megamenu-pop shadow-sm', html : true, placement: 'bottom', animation: false, delay: { show: 100, hide: 200, }, container: 'header', content: function() { return jQuery('#dom-al-megamenu-content').html(); }, title: '', sanitize: false, }).on('hide.bs.popover', function () { if (jQuery(".al-megamenu-pop:hover").length) { return false; } }); jQuery('body').on('mouseleave', '.al-megamenu-pop', function(){ jQuery('.al-megamenu a').popover('hide'); }); } if(jQuery('body').hasClass('home') && jQuery('#al-master-intro').length) { jQuery(window).on('resize', function() { var total_height = jQuery(window).height(); if(isMobile()) { var logo_height = jQuery('#al-master-intro .col-lg-5').outerHeight(); var total_height = total_height - logo_height; } jQuery('.al-master-intro-btn').css('height', ((total_height/3))); }); } (function(){ var searchTerm, panelContainerId; // Create a new contains that is case insensitive jQuery.expr[':'].containsCaseInsensitive = function (a, i, m) { var rExps=[ {re: /[\xC0-\xC6]/g, ch: "A"}, {re: /[\xE0-\xE6]/g, ch: "a"}, {re: /[\xC8-\xCB]/g, ch: "E"}, {re: /[\xE8-\xEB]/g, ch: "e"}, {re: /[\xCC-\xCF]/g, ch: "I"}, {re: /[\xEC-\xEF]/g, ch: "i"}, {re: /[\xD2-\xD6]/g, ch: "O"}, {re: /[\xF2-\xF6]/g, ch: "o"}, {re: /[\xD9-\xDC]/g, ch: "U"}, {re: /[\xF9-\xFC]/g, ch: "u"}, {re: /[\xC7-\xE7]/g, ch: "c"}, {re: /[\xD1]/g, ch: "N"}, {re: /[\xF1]/g, ch: "n"} ]; var element = $(a).text(); var search = m[3]; jQuery.each(rExps, function() { element = element.replace(this.re, this.ch); search = search.replace(this.re, this.ch); }); return element.toUpperCase() .indexOf(search.toUpperCase()) >= 0; }; jQuery(document).on('change keyup paste', '#dom_prods_search_dom', function(event) { searchTerm = jQuery(this).val(); jQuery('.dom-producto-catalogo').each(function () { panelContainerId = '#' + jQuery(this).attr('id'); jQuery(panelContainerId + ':not(:containsCaseInsensitive(' + searchTerm + '))').addClass('d-none'); jQuery(panelContainerId + ':containsCaseInsensitive(' + searchTerm + ')').removeClass('d-none'); }); }); }()); if(jQuery('body').hasClass('term-alien-basics')) { jQuery(document).on('click', '.al-back-to-cats', function(event) { jQuery('#dom_loader').css('display', 'flex').hide().fadeToggle(); jQuery('#dom_prods_archive_precontent .col-lg-4').fadeIn(); jQuery('.dom-cat-filter-chk').each(function(){ jQuery(this).attr('checked', false); }); jQuery('#dom-products-cat-filter-opt button[data-filter=".mix"]').click(); jQuery('#dom-all-products, .al-back-to-cats, .dom-search-sidebar-comp').fadeOut(); setTimeout(() => { jQuery('#dom_loader').fadeOut(); }, '1000'); }); jQuery(document).on('click', '#dom_prods_archive_precontent .dom-producto-catalogo a', function(event) { event.preventDefault(); var filter = jQuery(this).data('toggle_filter'); jQuery('#dom_loader').css('display', 'flex').hide().fadeToggle('fast'); jQuery('#dom_prods_archive_precontent .col-lg-4').fadeOut(); jQuery('#dom-all-products, .al-back-to-cats').fadeIn(); jQuery('#fit_filter_'+filter).click(); var containerEl = document.querySelector('#dom-all-products'); var mixer = mixitup(containerEl); mixer.toggleOn('.'+filter) .then(function(state) { setTimeout(() => { jQuery('#dom_loader').fadeOut(); jQuery([document.documentElement, document.body]).animate({ scrollTop: jQuery('#dom-all-products').offset().top }, 500); }, '1000'); }); }); var cats_ids = jQuery('#al-basics-cats').val(); jQuery.ajax({ beforeSend: function (qXHR, settings) { jQuery('#dom-all-products, .dom-search-sidebar-comp').hide(); }, type : "POST", url : dominus_store.ajaxurl, async: false, data : jQuery.param({'cats_ids': cats_ids,'action': 'render_top_categories'}), error: function(response){ }, }).done(function(response) { result = response; jQuery('#dom_prods_archive_precontent').html(result.data.html); jQuery('#dom_prods_archive_precontent .dom-producto-catalogo a').each(function(){ jQuery(this).addClass('dom_no_track_click'); jQuery(this).parents().eq(1).removeClass('mix'); jQuery(this).find('h2').text(jQuery(this).attr('title')); }); }); } if(jQuery('.dom-horizontal-scroll-row').length) { new dom_horiz_scroll('.dom-horizontal-scroll-row'); } if(jQuery('body').hasClass('home') && jQuery('#al-master-intro').length) { var total_height = jQuery(window).height(); if(isMobile()) { var logo_height = jQuery('#al-master-intro .col-lg-5').outerHeight(); var total_height = total_height - logo_height; } jQuery('.al-master-intro-btn').css('height', ((total_height/3))); ScrollReveal().reveal('#al-master-intro #site-title img', {delay: 100, scale: 0.8, origin: 'top', opacity: 0, distance: '500px'}); ScrollReveal().reveal('.al-master-intro-btn-cont', {delay: 400, scale: 0.3, origin: 'left', opacity: 0, distance: '400px', interval: 100, easing: 'ease-out' }); } /* if(jQuery('body').hasClass('home') || jQuery('body').hasClass('single-dom_products')) { jQuery('#al-lo-nuevo-home a.dom-product-image > div, #dom-related-products a.dom-product-image > div').each(function(){ jQuery(this).append('
'); }); } if(jQuery('body').hasClass('single-dom_products')) { jQuery('#dom-single-product-price').append(' #SALE