$(document).ready(function () { if ($('.main-header .FH').length){ // FASHION DEPTH ========== var fullMenu = ''; $('ul.base-menu li.ifDrop').each(function(){ fullMenu = fullMenu + ''; }); $('.nav-menu.base-menu').addClass('container-h'); $('ul.base-menu li.all-product-button').remove(); $('ul.base-menu').prepend(fullMenu); $('ul.base-menu li > a > i').removeClass('fa-angle-right'); $('ul.base-menu li > a > i').addClass('fa-angle-down'); $('ul.base-menu ul.drop-list').each(function(){ if(!$(this).parent('div.menu-dd').length){ $('').insertBefore($(this)); } }) $('div.menu-dd').each(function(){ var image = $(this).next('ul.drop-list').find('li.image').html(); var slider = $(this).next('ul.drop-list').find('li.slider-menu').html(); $(this).next('ul.drop-list').find('li.image').remove(); $(this).next('ul.drop-list').find('li.slider-menu').remove(); var subcat = $(this).next('ul.drop-list').html(); if(subcat != undefined){ var w = $(this).next('ul.drop-list').hasClass('w60') ? 'w60' : 'w100'; $(this).next('ul.drop-list').remove(); $(this).append(''); if ( $(image).length ) { $(this).append('
'+image+'
'); } if ( $(slider).length ) { $(this).append('
'+slider+'
'); } } }); // BASE MENU ========== $('ul.base-menu').show(); }; // FIXED HEADER function fixNav(){ if (!$('.cart-menu').length && !$('.-g-template-black-friday').length){ var nav = $('.main-header'); var pos = nav.height(); var posDelay = nav.height()*2; var prevScroll = 0; nav.addClass('fix-nav'); $(window).scroll(function () { var fix = ($(this).scrollTop() > posDelay) ? true : false; if(fix){ nav.addClass('fade-menu', fix); setTimeout(function() { nav.addClass('animate-menu'); }, 250); $('body').css('margin-top', pos); if($(this).scrollTop() > prevScroll){ nav.removeClass('active-menu'); }else{ nav.addClass('active-menu'); } }else{ $('body').css('margin-top', 0); nav.removeClass('fade-menu active-menu animate-menu', fix); } prevScroll = $(this).scrollTop(); }); } } $.Gomag.bind('Widget/Add/After', function(){ fixNav(); // BF SIDEBAR + MENU STICKY if($('.-g-template-black-friday').length){ $('.main-header').css({'top' : '-' + ($('.discount-tape').height() + $('.top-head-bg').height()) + 'px'}); } if($( window ).width() > 991 && $('.-g-template-black-friday').length){ $('.landing-h .side-menu.fixed').css({'top' : $('#navigation').outerHeight() + 20 + 'px'}); } }); // FASHION MENU ========== function Menu(){ $('.menu-dd').each(function() { var $this = $(this); var Nli = $this.find('li').length; var Nlink = $this.find('a').length; var Ncol = Math.ceil(Nlink / 15); var Mbanner = $this.find('.cat-img').length; Ncol = Ncol == 0 ? 1 : Ncol; col = Nli > Ncol ? Ncol : Nli; col = (col + (Mbanner ? 1 : 0) > 4) ? 4 : col; $this.addClass('column' + col); if (Mbanner){$this.addClass('banner');}; if ($this.find('li span > a').length == 0){ $this.addClass('no-sub'); }; if ($this.hasClass('column4')){ $this.parent().addClass('initial-h'); }; }); }; Menu(); $('.main-header .menu-drop').hover(function() { $('.main-header .menu-drop .menu-dd').removeClass('open'); $(this).children('.menu-dd').stop().addClass('open'); if ( $('.slide-item-menu').length ) { $('.slide-item-menu').owlCarousel({items:1,navigation:!0,pagination:!1}); // get owl element var owl = $('.slide-item-menu'); // get owl instance from element var owlInstance = owl.data('owlCarousel'); // if instance is existing if(owlInstance != null) owlInstance.reinit(); }; },function() { $('.main-header .menu-drop .menu-dd').removeClass('open'); }); // HEADER if($( window ).width() > 1090 ){ var sld_new_title = $('.slider_new_h .title-carousel').detach(); $('.slider_new_h .holder').append(sld_new_title); } // LIST if($('.category-sld').length){ $('.catTitle').insertBefore('.category-sld'); } $('.filter-group').addClass('clearfix'); $(document).on('click', '#nav-filter:not(.mm-nav-filter) .filter.box .title-h', function(e){ e.preventDefault(); $(this).addClass('ignore'); $('#nav-filter:not(.mm-nav-filter) .filter.box .title-h').each(function(){ if(!$(this).hasClass('ignore')){ $(this).removeClass('ttl-bg') } }) $(this).removeClass('ignore'); $(this).toggleClass('ttl-bg'); $(this).next().addClass('ignoreSlide'); $('#nav-filter:not(.mm-nav-filter) .option-group').each(function(){ if(!$(this).hasClass('ignoreSlide')){ $(this).hide(); } }) $(this).next().removeClass('ignoreSlide'); $(this).next().toggle(); }); $(document).mouseup(function(e) { var container = $('#nav-filter:not(.mm-nav-filter) .filter.box:not(.-g-category-filters-remove-all)'); if (!container.is(e.target) && container.has(e.target).length === 0){ $(this).find('.option-group').removeClass('ignore').hide(); $(this).find('.title-h').removeClass('ttl-bg'); } }); //change filter holder $('#nav-filter:not(.mm-nav-filter) .filter.box:not(.-g-category-filters-remove-all)').each(function(){ var filterh = $(this).html(); $(this).find('.title-h,.option-group,.more-filter').remove(); $(this).prepend('
'+filterh+'
'); }); if ($(window).width() > 768) { $('.result-section .order-type').insertAfter('.filter.box:last-child'); $('.order-type').addClass('filter box'); $('.list-grid').insertAfter('.order-type'); }; //DETAIL if($('#product-page').length){ $('.breadcrumbs-default').insertBefore('.detail-title .title'); $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.product-top .stock-status').insertAfter('.add-section .add2cart'); $('.detail-share').insertAfter('.wish-section'); $('.detail-page').next('.carousel-slide').addClass('detail-similar'); /* Inlocuit cu CSS, incurca la _Base if($( window ).width() > 1090 ){ var sld_sim_title = $('.detail-recomended .title-carousel').detach(); $('.detail-recomended .holder').append(sld_sim_title); } */ $('.prod-lg-sld .slick-prev').insertBefore('.prod-lg-sld .slick-next'); $('.prod-lg-sld .slick-dots').insertBefore('.prod-lg-sld .slick-next'); $('.detail-tabs h2').removeClass('resp-accordion'); } /* Nu functioneaza, sectiunea se incarca cu Ajax //comment box if($('.product-comment-box .comment-row').length){ $('.product-comment-box .comment-row').each(function(){ var title_com = $(this).find('.comment-title').detach(); var author_com = $(this).find('.comment-author').detach(); $(this).prepend('
'); var com_info = $(this).find('.com-left-side').nextAll('p').detach(); $(this).append('
'); $(this).find('.com-left-side').append(title_com, author_com); $(this).find('.com-right-side').append(com_info); var rev_title = $(this).find('.comment-title .title').detach(); $(this).find('.com-right-side').prepend(rev_title); }) } */ //CART if($('#shoppingcart').length){ $('.bottom-section .holder').remove(); } // After AJAX Complete $.Gomag.bind('Product/Details/After/Ajax/Load/Complete', function(response){ $('.breadcrumbs-default').insertBefore('.detail-title .title'); $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.product-top .stock-status').insertAfter('.add-section .add2cart'); $('.detail-share').insertAfter('.wish-section'); }); }); /* expomob.ro JS file */ var getDefaultURL = window.location.href; var sectPos = $(window).scrollTop(); var winW = $(window).width(); var winH = $(window).height(); var mobileViewport = 1024; var getUserAgent = navigator.userAgent; var newEqProductRow_eventType = 'src-done'; var newEqProductRow_tm_int_val = 0; $.Gomag.bind('Product/Configuration/Price/Update', function(event, prices){ if(typeof prices === 'object' && prices.prices != undefined && typeof prices.prices === 'object') { let p = prices.prices; let finalPrice = p.finalPrice; let basePrice = p.basePrice; let currency = p.currency; if(basePrice > finalPrice) { if(Math.floor(basePrice) == basePrice && $.isNumeric(basePrice)) { $('span.bPrice').html(basePrice.toFixed(0)+' '+currency); } } if(Math.floor(finalPrice) == finalPrice && $.isNumeric(finalPrice)) { $('span.fPrice').html(finalPrice.toFixed(0)+' '+currency); } } }) function newEqProductRow(){ if(newEqProductRow_eventType == "ajx-stop"){ newEqProductRow_tm_int_val = 500; } var caroSlidBox = $('.carousel-slide .product-box'), caroSlid = $('.carousel-slide'), categHBox = $('.product-listing .product-box, .product-list .product-box'), categH = $('.product-listing, .product-list'), setIntForSlideLenght = '', caroItemH = 0; // if we detect carousel owl list of items if(caroSlidBox.length){ clearInterval(setIntForSlideLenght); setIntForSlideLenght = setInterval(function(){ if(caroSlid.find('.owl-wrapper').length){ caroSlid.each(function(){ caroItemH = 0; var thisCarolusel = $(this); if(thisCarolusel.hasClass('in-view')){ if(!thisCarolusel.hasClass('in-view-recalc')){ console.log(111); thisCarolusel.find('.figcaption').removeAttr('style'); thisCarolusel.find('.figcaption').each(function() { caroItemH = Math.max(caroItemH, $(this).outerHeight()); }).height(caroItemH).addClass('owl-f latest-owl-f '+newEqProductRow_eventType); thisCarolusel.addClass('in-view-recalc'); } } }); } },newEqProductRow_tm_int_val); }; } function browserDetect(){ if( getUserAgent.indexOf('Firefox/') > -1 && winW > mobileViewport ){ jQuery('body').addClass('cls-firefox cls-firefox-desktop'); }else if( getUserAgent.indexOf('Chrome/') > -1 && winW > mobileViewport ){ jQuery('body').addClass('cls-chrome cls-chrome-desktop'); }else if( getUserAgent.indexOf('Safari/') > -1 && winW > mobileViewport ){ jQuery('body').addClass('cls-safari cls-safari-desktop'); }else if( getUserAgent.indexOf('Firefox/') > -1 && winW <= mobileViewport ){ jQuery('body').addClass('cls-firefox cls-firefox-mobile'); }else if( getUserAgent.indexOf('Chrome/') > -1 && winW <= mobileViewport ){ jQuery('body').addClass('cls-chrome cls-chrome-mobile'); }else if( getUserAgent.indexOf('Safari/') > -1 && winW <= mobileViewport ){ jQuery('body').addClass('cls-safari cls-safari-mobile'); } } browserDetect(); var winH_diff = 0; var eqProductRow_Update_clearTm = ''; function eqProductRow_Update(){ if(jQuery('body').hasClass('cls-firefox-desktop')){ if(jQuery('.carousel-slide .figcaption').length){ clearTimeout(eqProductRow_Update_clearTm); eqProductRow_Update_clearTm = setTimeout(function(){ newEqProductRow(); },500) jQuery('.carousel-slide').each(function(){ var sect_top_pos = jQuery(this).offset().top; if((sect_top_pos-((winH/2)+winH_diff)) >= sectPos){ //jQuery(this).removeClass('in-view'); }else{ jQuery(this).addClass('in-view'); } }) } } } function lazyElements(){ if ($('div[data-oembed-url] iframe').length){ $('div[data-oembed-url] iframe').each(function () { if(!$(this).hasClass('cls-iframe-loading-lazy')){ var getThisAttrLazy = $(this).attr('loading'); var getThisAttrSrc = $(this).attr('src'); $(this).attr('src',lazyImg); if (typeof getThisAttrLazy == 'undefined') { $(this).addClass('cls-iframe-loading-lazy cls-iframe-oembed').attr('loading', 'lazy').attr('data-originsrc', getThisAttrSrc); } } if(!$(this).hasClass('scroll-lazy')){ var sect_top_pos = $(this).offset().top; if((sect_top_pos-winH) >= sectPos){ //$(this).removeClass('scroll-lazy'); }else{ var getCurrentOriginSrc = $(this).attr('data-originsrc'); if(typeof getCurrentOriginSrc !== 'undefined'){ $(this).addClass('scroll-lazy').attr('src',getCurrentOriginSrc); } } } }) } if ($('.box-video iframe').length) { console.log(333); $('.box-video iframe').each(function () { if(!$(this).hasClass('cls-iframe-loading-lazy')){ var getThisAttrLazy = $(this).attr('loading'); var getThisAttrSrc = $(this).attr('src'); $(this).attr('src',lazyImg); if (typeof getThisAttrLazy == 'undefined') { $(this).addClass('cls-iframe-loading-lazy cls-iframe-boxvideo').attr('loading', 'lazy').attr('data-originsrc', getThisAttrSrc); } } if(!$(this).hasClass('scroll-lazy')){ var sect_top_pos = $(this).offset().top; if((sect_top_pos-winH) >= sectPos){ //$(this).removeClass('scroll-lazy'); }else{ var getCurrentOriginSrc = $(this).attr('data-originsrc'); if(typeof getCurrentOriginSrc !== 'undefined'){ $(this).addClass('scroll-lazy').attr('src',getCurrentOriginSrc); } } } }) } } lazyElements(); function prodDetails(){ if($('#product-page').length){ if($('.detail-prod-attr .show-attributes').length){ $('.detail-prod-attr .show-attributes').each(function(){ if( $(this).text().toLowerCase().indexOf('configurează produsul') > -1 || $(this).text().toLowerCase().indexOf('configureaza produsul') > -1 ){ $(this).addClass('new-conf-description'); } if( $(this).text().toLowerCase().indexOf('paletar materiale') > -1 || $(this).text().toLowerCase().indexOf('vezi materialele disponibile') > -1 ){ $(this).addClass('new-conf-description title'); } if( $(this).text().toLowerCase().indexOf('info configurare') > -1 ){ $(this).addClass('new-conf-info'); } }); } // activate the configurations if( $('#product-page .-g-product-row-box .detail-prod-attr .detail-product-atributes > .-g-product-configurations-holder').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .detail-product-atributes > .-g-product-configurations-holder').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .detail-product-atributes > .-g-product-configurations-holder').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the version-attribute if( $('#product-page .-g-product-row-box .-g-version-attribute-holder').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .-g-version-attribute-holder').hasClass('new-ver')){ $('#product-page .-g-product-row-box .-g-version-attribute-holder').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the __shippingDeliveryTime if( $('#product-page .-g-product-row-box .detail-product-atributes .__shippingDeliveryTime').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-product-atributes .__shippingDeliveryTime').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-product-atributes .__shippingDeliveryTime').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the product-code if( $('#product-page .-g-product-row-box .detail-prod-attr .product-code').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .product-code').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .product-code').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the gift-h if( $('#product-page .-g-product-row-box .detail-prod-attr .gift-h').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .gift-h').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .gift-h').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the add-section if( $('#product-page .-g-product-row-box .detail-prod-attr .add-section').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .add-section').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .add-section').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // activate or not the new-conf-description if( $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').length && $('#product-page .-g-product-row-box .detail-prod-attr > .-g-product-configurations-holder').length ){ var element_style = $('#product-page .-g-product-row-box .detail-prod-attr > .-g-product-configurations-holder').attr('style'); if(typeof element_style !== 'undefined'){ if( element_style.indexOf('display: none') > -1 || element_style.indexOf('display:none') > -1 ){ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').removeClass('act'); }else{ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').addClass('act'); } }else{ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').addClass('act'); } }else if( $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').length && $('#product-page .-g-product-row-box .detail-product-atributes > .-g-product-configurations-holder').length < 1 ){ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').removeClass('act'); } // move the new-conf-description if( $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').length && $('#product-page .-g-product-row-box .detail-prod-attr > .-g-product-configurations-holder').length ){ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').addClass('new-ver').insertBefore('#product-page .-g-product-row-box .detail-prod-attr > .-g-product-configurations-holder'); }else if( $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').length && $('#product-page .-g-product-row-box .detail-price').length ){ $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-description').addClass('new-ver').insertAfter('#product-page .-g-product-row-box .detail-price'); } // move the stock-status if( $('#product-page .-g-product-row-box .detail-prod-attr .add-section').length && $('#product-page .-g-product-row-box .detail-prod-attr .add-section .stock-status').length < 1 ){ if($('#product-page .-g-product-row-box .detail-prod-attr .detail-product-atributes .stock-status').length){ $('#product-page .-g-product-row-box .detail-prod-attr .detail-product-atributes .stock-status').appendTo('#product-page .-g-product-row-box .detail-prod-attr .add-section'); } } // if select exist transform element a little bit if( $('.selectS ul.on').length && $('.selectS > label .fa-times').length ){ $('.selectS ul.on').removeClass('on'); $('.selectS > label .fa-times').addClass('fa-angle-down').removeClass('fa-times'); } // move the wish-section if( $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').length && $('#product-page .-g-product-row-box .-g-product-configurations-holder').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .wish-section').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').addClass('new-ver new-after-configurations').insertAfter('#product-page .-g-product-row-box .-g-product-configurations-holder'); } }else if( $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').length && $('#product-page .-g-product-row-box .gift-h').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .wish-section').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').addClass('new-ver new-after-gift').insertAfter('#product-page .-g-product-row-box .gift-h'); } }else if( $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').length && $('#product-page .-g-product-row-box .detail-price').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .wish-section').hasClass('new-ver')){ $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').addClass('new-ver new-after-detail-price').insertAfter('#product-page .-g-product-row-box .detail-price'); } } // move the new-conf-info if( $('#product-page .-g-product-row-box .detail-prod-attr .new-conf-info').length && $('#product-page .-g-product-row-box .detail-prod-attr .wish-section').length ){ if(!$('#product-page .-g-product-row-box .detail-prod-attr .new-conf-info').hasClass('new-ver')){ $('#product-page.-g-product-row-box .detail-prod-attr .new-conf-info').addClass('new-ver').insertBefore('#product-page .-g-product-row-box .detail-prod-attr .wish-section'); } } if($('.detail-prod-attr .-g-versions-attribute-name').length){ $('.detail-prod-attr .-g-versions-attribute-name').each(function(){ if(!$(this).hasClass('new-versions-attribute-name')){ if($(this).text().toLowerCase().trim().indexOf('colț reversibil') > -1){ $(this).addClass('versions-attribute-orientation'); } $(this).addClass('new-versions-attribute-name'); } }) } // getShippingInfo / transport-info move if( $('.-g-product-row-box .detail-prod-attr .transport-info').length && $('.-g-product-row-box .detail-prod-attr .detail-price .-g-discount-value').length ){ if(!$('.-g-product-row-box .detail-prod-attr .transport-info').hasClass('dom-moved')){ $('.-g-product-row-box .detail-prod-attr .transport-info').html('Produsul beneficiază de Livrare Gratuită ').addClass('dom-moved').insertAfter($('.-g-product-row-box .detail-prod-attr .detail-price .-g-discount-value')); } }else if( $('.-g-product-row-box .detail-prod-attr .transport-info').length && $('.-g-product-row-box .detail-prod-attr .detail-price').length ){ if(!$('.-g-product-row-box .detail-prod-attr .transport-info').hasClass('dom-moved')){ $('.-g-product-row-box .detail-prod-attr .transport-info').html('Produsul beneficiază de Livrare Gratuită ').addClass('dom-moved').appendTo($('.-g-product-row-box .detail-prod-attr .detail-price')); } } if($('.detail-tabs h2.tab-grup').length){ $('.detail-tabs h2.tab-grup').each(function(elm){ var getTheTxt = $(this).text().toLowerCase().trim().replace(/⚠️/g,'').replace(/ /g,'_').replace(/ă/g,'a').replace(/ș/g,'s').replace(/[{}]/g,'');; $(this).addClass('cls-'+getTheTxt+' cls-elm_'+(elm+1)); $(this).next('.tab-pane').addClass('cls-tab-'+getTheTxt+' cls-tab-elm_'+(elm+1)); if(getTheTxt.indexOf('descriere') > -1){ $(this).addClass('cls-descriere'); if($(this).hasClass('cls-elm_1')){ $(this).html(' Informatii produs'); } } }) } if($('.detail-tabs .resp-tab-content').length){ $('.detail-tabs .resp-tab-content').each(function(elm){ $(this).addClass('new-resp-tab-content').removeClass('resp-tab-content'); }) } } } prodDetails(); function plataRadu(){ var element = $('.main-footer').find('div.payment-accepted').find('img[alt="euPlatesc"]'); if(element.length) { var img = element[0].outerHTML; $(element).replaceWith(''+img+''); } } function moveDeskHeadEl(){ if( $('.top-head-bg .acount-section .-g-user-icon').length && $('.top-head-bg .acount-section .cart-header-btn').length ){ $('.top-head-bg .acount-section .-g-user-icon').insertBefore('.top-head-bg .acount-section .cart-header-btn'); } } moveDeskHeadEl(); function moveBrand(){ if($('.product-box').length){ $('.product-box').each(function(){ if( $(this).find('.top-side-box .brand').length && !$(this).hasClass('b-m') ){ $(this).addClass('b-m'); $(this).find('.top-side-box .brand').insertAfter($(this).find('.top-side-box h2')); } }); } } moveBrand(); function stockStatus(){ if($('.stock-status').length){ $('.stock-status').each(function(){ if(!$(this).hasClass('stock-status-checked')){ var newTxt = "Nu este in stoc"; var thisHtml = $(this).html().trim(); var thisHtmlLength = $(this).html().trim().length; if( thisHtml.indexOf('Nu este in stoc') < 0 && $(this).hasClass('unavailable') && thisHtmlLength <= 56 ){ $(this).html(thisHtml+newTxt).addClass('stock-status-updated'); } $(this).addClass('stock-status-checked'); } }) } } stockStatus(); var targetOrd = $('.order-type'); function orderTp(){ if ( targetOrd.length ){ if( $('#nav-filter .filter-holder').find(targetOrd).length < 1 && $(window).width() >= 768 ){ targetOrd.appendTo($('#nav-filter .filter-holder')); targetOrd.addClass('filter box'); }else if( $('.category-content .result-section').find(targetOrd).length < 1 && $(window).width() < 768 ){ targetOrd.appendTo($('.category-content .result-section')); targetOrd.removeClass('filter box'); } } } function fixtSlickThumb(){ var elmToFix = $('.thumb-h'); if(elmToFix.length){ if(elmToFix.hasClass('horizontal')){ //elmToFix.removeClass('horizontal').addClass('n-horizontal'); $('.thumb-sld, .prod-lg-sld').slick('unslick'); if ($('.gomag-ixaria-container').length){ $('.prod-lg-sld').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, fade: true, draggable: false, swipe: false, asNavFor: '.thumb-sld' }); } else { $('.prod-lg-sld').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, fade: true, asNavFor: '.thumb-sld' }); } $('.thumb-sld').slick({ vertical: false, slidesToShow: 6, slidesToScroll: 1, asNavFor: '.prod-lg-sld', dots: false, infinite: false, centerMode: true, focusOnSelect: true }); var getTheLeng = $('.thumb-h li').length; if(getTheLeng >= 4){ getTheLeng = (getTheLeng / 2).toFixed(0); // $('.thumb-h li:nth-child('+getTheLeng+') a').click(); } } } } function headPhoneCheck(){ if($('.-g-template-black-friday').length){ // soon if( $('.acount-section > ul > .contact-header').length > 0 && $('.acount-section > ul > .contact-header').length < 2 && $('.bottom-section .support .support-contact').length > 1 ){ var firstPhone = '
  • '; $(firstPhone).insertBefore('.acount-section > ul > .contact-header'); $('.bottom-section .support .support-contact').first().clone().appendTo('.first-phone'); $('1').prependTo('.first-phone a'); } } } headPhoneCheck(); function menuUpdate() { if( $('.mm-mobile-menu.main-menu ul li a[title="Canapele"]').length && $('.mm-mobile-menu.main-menu ul li a[title="Canapele"] > img').length < 1 ){ var catIcon = ''; $(catIcon).prependTo('.mm-mobile-menu.main-menu ul li a[title="Canapele"]'); } if( $('.mm-mobile-menu.main-menu ul li a[title]').length ){ $('.mm-mobile-menu.main-menu ul li > a[title]').each(function(){ var getTitle = $(this).attr('title').toLowerCase().trim().replace(/ /g,'_'); $(this).addClass('new_cls-'+getTitle); $(this).parent().addClass('new_prt_cls-'+getTitle); }) } // simple dynamic class creator if( $('.mm-mobile-menu.main-menu ul .new_prt_cls-magazinele_expomob').length && $('.mm-mobile-menu.main-menu ul .new_prt_cls-blog').length ){ $('.mm-mobile-menu.main-menu ul .new_prt_cls-magazinele_expomob').addClass('dom-moved').insertBefore('.mm-mobile-menu.main-menu ul .new_prt_cls-blog'); } } var tmForSlideDown = ''; var scrollDifferentPosition = 200; var animSpeed = 200; $(document).on('click','.detail-tabs h2.tab-grup',function(){ if($(window).width() <= 768){ var getThisTab = $(this); clearTimeout(tmForSlideDown); if(getThisTab.next('.new-resp-tab-content').length){ //getThisTab.parent().find('.new-resp-tab-content').stop().slideUp(animSpeed); tmForSlideDown = setTimeout(function(){ //getThisTab.next('.new-resp-tab-content').stop().slideDown(animSpeed); //getThisTab.toggleClass('resp-tab-active'); getThisTab.next('.new-resp-tab-content').stop().slideToggle(animSpeed); //$('html, body').animate({ scrollTop: getThisTab.offset().top - scrollDifferentPosition}, animSpeed); },animSpeed); } } }); $(document).ready(function(){ fixtSlickThumb(); plataRadu(); orderTp(); if($('.product-box').length){ $('.product-box').each(function(){ var icons = $(this).find('.product-icon-box').clone(); $(this).find('.-g-listing-version-attribute-holder').after(icons); }); } if ($('#product-page').length){ $('.main-header').addClass('product-header'); } }); function changeRecomandedProductsTitle() { if($('.detail-recomended .carousel-slide p.title').length){ $.each($('.detail-recomended .carousel-slide p.title'), function (indexInArray, valueOfElement) { if(this.innerHTML == 'Produsul achizitionat se potriveste cu'){ this.innerHTML = 'Recomandari'; } }); } } $(window).load(function(){ menuUpdate(); changeRecomandedProductsTitle(); }); $(document).ajaxComplete(function(){ moveBrand(); moveDeskHeadEl(); prodDetails(); stockStatus(); }); $(window).resize(function(){ //orderTp(); }); jQuery(document).scroll(function(){ jQuery('body').addClass('bd-scrl'); newEqProductRow_eventType = 'src-scrl'; sectPos = $(window).scrollTop(); eqProductRow_Update(); }); function solveArea() { var width=document.getElementById("width").value; var length=document.getElementById("length").value; var area=width*length; document.getElementById("area").value=area; } $('.nav-menu-hh .menu-dd').each(function(){ if($(this)[0].getBoundingClientRect().right > window.innerWidth){ $(this).addClass('outsidescreen'); } }); $(window).resize(function(){ $('.nav-menu-hh .menu-dd').each(function(){ if($(this)[0].getBoundingClientRect().right > window.innerWidth){ $(this).addClass('outsidescreen'); } else {$(this).removeClass('outsidescreen')} }); }); $(document).ready(function(){ if($('#nav-filter').length && $('.productCategory').length){ $('#nav-filter').insertAfter('.productCategory').addClass('moveEnd'); } });