$(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(); }; if ( $('.discount-tape').length){ var hellobar = $('.discount-tape').detach(); $('.main-header #navigation:first').prepend(hellobar); }; // 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'); }); //FIXED-HEADER if($( window ).width() > 1090 && $('.-g-pagetype-homepage').length){ var nav = $('#navigation'); var pos = nav.height(); $(window).scroll(function () { var fix = ($(this).scrollTop() > pos) ? true : false; nav.toggleClass("fix-nav", fix); if(fix){ $('#logo svg .st0').css('fill', '#000'); } else { $('#logo svg .st0').css('fill', '#fff'); }; }); }; // BF SIDEBAR + MENU STICKY $.Gomag.bind('Widget/Add/After', function(){ if($('.-g-template-black-friday').length){ $('.main-header').css({'top' : '-' + $('.discount-tape').height() + 'px'}); } if($( window ).width() > 991 && $('.-g-template-black-friday').length){ $('.landing-h .side-menu.fixed').css({'top' : $('#navigation .main-menu').outerHeight() + 20 + 'px'}); } }); if($('.main.search-form-box').length){ var logo = $('#logo').detach(); if($('.logo-h .btn').length){ var backToHome = $('.logo-h .btn').detach(); $('.menu-trg').after('
'); $('.-g-logo-btn-holder').append(logo, backToHome); }else{ logo.insertAfter('.menu-trg'); } $('.cart-header-btn').insertAfter('.search-m'); }; if($('.-g-pagetype-homepage').length){ $('#navigation').addClass('over-top'); }; if($('#contact-page').length){ $('.breadcrumb').hide(); $('#contact-map').insertBefore('#contact-page'); }; //DETAIL var breadcrumbs = $('.breadcrumbs-default').detach(); $('.detail-title .title').before(breadcrumbs); var share_section = $('.detail-share').detach(); $('.wish-section:not(.customer-points)').after(share_section); $('.detail-tabs').insertAfter('.detail-prod-attr'); if($('.extra-offer').length){ $('.extra-offer').insertBefore('.detail-tabs'); } if($('.extra-offer .slide-item-4').length){ $('.extra-offer .slide-item-4').each(function(){ $(this).data('owlCarousel').destroy(); $(this).owlCarousel({ items: 2, navigation:true, pagination:false, itemsCustom : [[0,2],[450, 2],[600, 3],[700, 4],[991, 2],[1200, 2],[1300, 2]] }); }); }; if($('.detail-tabs .blog-posts-sld').length){ setTimeout(function(){ $('.detail-tabs .blog-posts-sld').each(function(){ $(this).data('owlCarousel').destroy(); $(this).owlCarousel({ items: 2, navigation:true, pagination:false, itemsCustom : [[0,1],[450, 2],[600, 2],[700, 3],[991, 2],[1200, 2],[1300, 2]] }); }); }, 150); }; $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.thumb-sld').slick('unslick'); $('.thumb-sld').slick({ vertical: false, slidesToShow: 5, slidesToScroll: 1, asNavFor: '.prod-lg-sld', dots: false, infinite: false, focusOnSelect: true }); $('.wish-section .addToWishlist').insertAfter('.add-section .add2cart').addClass('btn').html('').show(); var wishPP = $('.wish-section .wishlist-pp').detach(); $('.wish-section .addToWishlist').after(wishPP); function reinitEasyResponsiveTabs() { $('#resp-tab').easyResponsiveTabs({ type: 'default', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container tabidentify: 'tab-grup', // The tab groups identifier activate: function(event) { // Callback function if tab is switched var $tab = $(this); var $info = $('#nested-tabInfo'); var $name = $('span', $info); $name.text($tab.text()); $info.show(); } }); }; // After AJAX Complete $.Gomag.bind('Product/Details/After/Ajax/Load/Complete', function(response){ $('.detail-title .title').before(breadcrumbs); $('.thumb-h').addClass('horizontal').insertAfter('.vertical-slide-img'); $('.thumb-sld').slick('unslick'); $('.thumb-sld').slick({ vertical: false, slidesToShow: 5, slidesToScroll: 1, asNavFor: '.prod-lg-sld', dots: false, infinite: false, focusOnSelect: true }); $('.wish-section').after(share_section); $('.wish-section .addToWishlist').insertAfter('.add-section .add2cart').addClass('btn').html('').show(); $('.addToWishlist').after(wishPP); if($('.extra-offer').length){ $('.extra-offer').insertBefore('.detail-tabs'); $('.extra-offer .slide-item-4').each(function(){ $(this).data('owlCarousel').destroy(); $(this).owlCarousel({ items: 2, navigation:true, pagination:false, itemsCustom : [[0,2],[450, 2],[600, 3],[700, 4],[991, 2],[1200, 2],[1300, 2]] }); }); }; }); }); /* GoMag janette.ro JS (NOI 2022) */ $("#_autocompleteSearchMobileToggle").attr("placeholder", "Cauta aici bijuteria preferata Janette.."); var ww = $(window).width(); function dinBodCls(){ if($('body #product-page').length){ $('body').addClass('prod-p'); }else if($('body #category-page').length){ $('body').addClass('cat-p'); }else if( $('body .bnn-group-left #main-bnn').length && $('body .landing-h .soon').length ){ $('body').addClass('home-landing-p'); }else if($('body .bnn-group-left #main-bnn').length){ $('body').addClass('home-p'); } if(window.self !== window.top){ $('body').addClass('ifr-p-tp'); } } dinBodCls(); function sliderChanges(){ if($('.detail-recomended .slide-item-2').length){ $('.detail-recomended .slide-item-2').addClass('slide-item-cus-4').removeClass('slide-item-2'); } $(document).ready(function(){ $('.slide-item-cus-4').owlCarousel({ itemsCustom : [[0,2],[450, 2],[600, 3],[700, 3],[1090, 4],[1200, 4],[1300, 4]], navigation : true, pagination: true }); }) } sliderChanges(); function transLate(){ if($('.title').length){ $('.title').each(function(){ if($(this).text().indexOf('Suport clienti') > -1){ $(this).text($(this).text().replace(/Suport clienti/g,'Suport clienți')); } if($(this).text().indexOf('Contacteaza-ne') > -1){ $(this).text($(this).text().replace(/Contacteaza-ne/g,'Contactează-ne')); } }); } if($('.regular-text').length){ $('.regular-text').each(function(){ if($(this).text().indexOf(' si ') > -1){ $(this).text($(this).text().replace(/ si /g,' și ')); } if($(this).text().indexOf('contactat(a)') > -1){ $(this).text($(this).text().replace(/contactat(a)/g,'contactat(ă)')); } }); } } // transLate(); if($('.mobile-icon .-g-user-icon').length){ $('.mobile-icon .-g-user-icon').insertBefore('.mobile-icon .cart-header-btn'); } // catDesc display more text function catReadMore(){ var readMoreBtn = 'Vezi mai mult'; var textDots = '...'; var firstTextWr = ''; var readMoreWrap = ''; // descriptionSecondValue displayMore categoryDescriptionDisplay new-v if($('.catDesc').length){ $('.catDesc').each(function(){ var targetEl = $(this); if( targetEl.find('.r-m-desktop').length || targetEl.find('.r-m-mobile').length ){ if( targetEl.find('.descriptionHid').length < 1 && targetEl.find('.readMore').length < 1 ){ var getCatHtmlCont = targetEl.html().replace(/ /g,''); function readMoreTextTrans(){ var getFirstHtml = getCatHtmlCont.substr(0, getTheIndexOfReadMore); var getRestOfHtml = getCatHtmlCont.substr(getTheIndexOfReadMore); targetEl.html(''); $(firstTextWr).appendTo(targetEl); targetEl.find('.descriptionTxt').html(getFirstHtml); $(textDots).appendTo(targetEl.find('.descriptionTxt')); $(readMoreWrap).appendTo(targetEl); targetEl.find('.descriptionHid').html(getRestOfHtml); $(readMoreBtn).appendTo(targetEl); setTimeout(function(){ if(targetEl.find('.readMore').parent().hasClass('descriptionSecondValue')){ targetEl.find('.readMore').appendTo(targetEl); targetEl.find('.descriptionSecondValue, .displayMore').remove(); } },500); } if( ww <= 1024 && targetEl.find('.r-m-mobile').length ){ if(getCatHtmlCont.indexOf('
') > -1){ var getTheIndexOfReadMore = getCatHtmlCont.indexOf('
'); }else{ var getTheIndexOfReadMore = getCatHtmlCont.indexOf('
'); } readMoreTextTrans(); }else if( ww > 1024 && targetEl.find('.r-m-desktop').length ){ if(getCatHtmlCont.indexOf('
') > -1){ var getTheIndexOfReadMore = getCatHtmlCont.indexOf('
'); }else{ var getTheIndexOfReadMore = getCatHtmlCont.indexOf('
'); } readMoreTextTrans(); } } } }); } } catReadMore(); $(document).on('click','.readMore',function(e){ $(this).parents('.catDesc').eq(0).toggleClass('open'); $(this).parents('.catDesc').eq(0).find('.descriptionHid').slideToggle(200, function() { var thisElSlide = $(this); if (thisElSlide.is(':visible')){ thisElSlide.css('display','inline'); }else{ thisElSlide.css('display','none'); } }); if($(this).parents('.catDesc').eq(0).hasClass('open')){ $(this).text($(this).attr('data-text-swap')); }else{ $(this).text("Vezi mai mult"); } e.preventDefault(); }); function footEl(){ if( $('.main-footer .-g-footer-company-data').length && $('.main-footer .col-md-3 .-g-footer-group').length ){ if($('.main-footer .col-md-3').first().find('.-g-footer-group').length > 1){ $('.main-footer .-g-footer-company-data').empty(); $('.main-footer .col-md-3').first().find('.-g-footer-group').first().next().appendTo('.main-footer .-g-footer-company-data'); $('.main-footer .-g-footer-company-data').removeClass('-g-footer-company-data'); } } if($('.-g-footer-affiliate-block').length){ // /domains/janette/files/files/janette-certificat-autorizatie-1809.jpg // /domains/janette/files/files/autorizatie-anpc-expresiv-style-1916.pdf var dynamicAdminData = ''; if($('.main-footer .payment-accepted a[href*="anpc.ro"]').length){ dynamicAdminData = $('.main-footer .payment-accepted a[href*="anpc.ro"]')[0].outerHTML; if($('.main-footer .payment-accepted a[href*="ec.europa.eu"]').length){ dynamicAdminData += $('.main-footer .payment-accepted a[href*="ec.europa.eu"]')[0].outerHTML; } } var getMobPay = $('.payment-accepted').html(); //$('.payment-accepted').remove(); var newAffBlk = ''; //$(newAffBlk).appendTo('.-g-footer-affiliate-block'); $('.-g-footer-affiliate-block').html(newAffBlk); } if(ww <= 480){ if( $('.main-footer .col-right').length && $('.main-footer .-g-footer-affiliate-block').length ){ $('.main-footer .col-right').insertAfter('.main-footer .-g-footer-affiliate-block'); } } } footEl(); function scrlWin(){ var getTopWP = $(window).scrollTop(); if(getTopWP >= 200){ $('body').addClass('scr-m-2'); }else{ $('body').removeClass('scr-m-2'); } } function pagEl(){ if($('#category-page .product-listing .pagination').length){ $('#category-page .product-listing .pagination').clone().addClass('cls-clone-pagination').prependTo('#category-page .product-listing'); } } pagEl(); function contactFunc(){ var telPhn = 'tel:0721335577'; if($('.phone-m a[href]').length){ telPhn = $('.phone-m a[href]').attr('href').replace('tel:+4','').replace('tel:','').replace('+4','').replace(/ /g,''); } var contactCont = '
'+telPhn+'
'; if($('body #wrapper').length){ $(contactCont).insertAfter('body #wrapper'); }else{ $(contactCont).appendTo('body'); } } function blogCont(){ if($('.-g-blog-page .-g-blog-fixed-categories').length){ if($.trim($('.-g-blog-page .-g-blog-fixed-categories').html()).length < 1){ $('.-g-blog-page').addClass('no-s-bar'); } }else if($('.-g-blog-homepage > .container-h > .row > .col-sm-3').length){ if($.trim($('.-g-blog-homepage > .container-h > .row > .col-sm-3').html()).length < 1){ $('.-g-blog-homepage').addClass('no-s-bar'); } } } blogCont(); function blogDetailsContent(){ // start only on details blog content if($('.-g-blog-post').length){ if($('.-g-blog-post .-g-post-content-detail').length){ if($('.-g-blog-post .-g-post-content-detail > div').length){ var thisStyle = $('.-g-blog-post .-g-post-content-detail > div').attr('style'); if(typeof thisStyle !== 'undefined'){ if( thisStyle.indexOf('text-align:') > -1 && thisStyle.indexOf('justify') > -1 ){ thisStyle = thisStyle.replace('text-align: justify;','').replace('text-align:justify;','').replace('text-align:justify',''); $('.-g-blog-post .-g-post-content-detail > div').attr('style',thisStyle).addClass('new-css-style'); } }else{ $('.-g-blog-post .-g-post-content-detail > div').addClass('no-new-css-style'); } } } } } //blogDetailsContent(); function cookieDis(){ if(document.cookie.indexOf('g_c_consent=1') > -1){ $('body').addClass('cookiePolicyGomagOn'); } if($('.cookiePolicyGomag').length){ $('.cookiePolicyGomag').addClass('dom-moved').appendTo('body'); } } function productStatus(){ if($('#product-page .detail-prod-attr .stock-status').length){ $('#product-page .detail-prod-attr .stock-status').each(function(){ if(!$(this).hasClass('cls-new-stock-status')){ if( $(this).hasClass('ultimele-bucati') || $(this).hasClass('ultima-bucata') ){ $(this).addClass('cls-new-stock-status'); if($('#product-page .detail-prod-attr .add-section .btn-cart').length){ $(this).prependTo('#product-page .detail-prod-attr .add-section .btn-cart'); } if($('#product-page .detail-prod-attr').length){ $('#product-page .detail-prod-attr').addClass('cls-price-last-products') } } } }) } } productStatus(); $(document).on('click','#__gomagCookiePolicy',function(){ $('body').addClass('cookiePolicyGomagOn'); }); function prodDet(){ if($('.detail-prod-attr .detail-price').length){ $('.detail-prod-attr .detail-price').insertBefore('.add-section'); } if( $('.detail-prod-attr .help-phone .-g-product-details-help-phone').length && $('.detail-prod-attr .help-phone .-g-product-details-help-phone').text().indexOf('Ai nevoie de ajutor?') > -1 ){ $('.detail-prod-attr .help-phone .-g-product-details-help-phone').text('Asistenta si suport: '); } if( $('.product-top .brand-detail').length && $('.product-top .brand-detail').text().trim() == "" ){ $('.product-top .brand-detail').remove(); } if( $('.thumb-sld').length && $('.thumb-h').length ){ $('.thumb-sld').slick('unslick'); $('.thumb-sld').slick({ vertical: true, slidesToShow: 4, slidesToScroll: 1, asNavFor: '.prod-lg-sld', dots: false, infinite: false, draggable: false, swipe: false, focusOnSelect: true }); $('.thumb-h').removeClass('horizontal'); $('.thumb-h').insertBefore('.vertical-slide-img'); } if( $('.detail-sld-similar .title-carousel .title').length && $('.detail-sld-similar .title-carousel .title').text().trim() == "Produse similare" ){ $('.detail-sld-similar .title-carousel .title').text("Îți recomandăm și"); } } function newsLetPop(){ if( $('.widget-type-newsletter .widget-content').length && $('.widget-type-newsletter .widget-popup-btn .btn.std').length ){ $('.widget-type-newsletter .widget-popup-btn .btn.std').clone().prependTo('.widget-type-newsletter .widget-content'); if($('.widget-type-newsletter .widget-content > .btn.std').length){ $('.widget-type-newsletter .widget-content > .btn.std').removeAttr('style'); } } } function loginUser(){ if( $('.top-head-bg .top-head .acount-section .-g-user-icon').length && $('.top-head-bg .top-head .acount-section .-g-user-icon').text().trim().indexOf('Bună,') > -1 && $('.main-header .main-menu').length ){ var getTheUserIcon = $('.top-head-bg .top-head .acount-section .-g-user-icon').html(); $(getTheUserIcon).appendTo('.main-header .main-menu'); $('.main-header .main-menu > a:last-child').addClass('new-user-icon'); } } loginUser(); $(document).ready(function(){ $('body').addClass('bd-ready'); scrlWin(); prodDet(); // TOGGLE FILTER /*$('.filter.box .title-h').click(function(){ $(this).parent().toggleClass('visible'); });*/ $('.-g-agreement-NewsletterInformation').hide(); $('input[name="agreeNewsletterInformation"]').attr('checked', true); if($('#wrapper').find('#newsletterError').length) { $('.contact-h').remove(); } }); $(window).load(function(){ $('body').addClass('bd-load'); cookieDis(); contactFunc(); // TOGGLE FILTER $('.filter.box .title-h').click(function(){ $(this).parent().toggleClass('visible'); }); }); $(document).ajaxComplete(function() { $('body').addClass('bd-ajaxcom'); prodDet(); newsLetPop(); productStatus(); }); $(window).scroll(function() { scrlWin(); }); if ($(window).width() < 480) { $('.stock-status').appendTo('.detail-price'); $('.icon-g-scroll .col:first-of-type').appendTo('.detail-price'); $('.-g-version-attribute-holder').parent().addClass('moved'); }