(function(win, doc) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); var activeSelectIndex = -1; $('.select-item').on('click', function() { var index = $(this).index(); if (activeSelectIndex != index) { activeSelectIndex = index; $('.select-item').removeClass('select-item_active'); $(this).addClass('select-item_active'); ShowSelectPopup(true, activeSelectIndex); } else { activeSelectIndex = -1; $('.select-item').removeClass('select-item_active'); ShowSelectPopup(false, activeSelectIndex); } }); $('.select-popup-mask').on('click', function() { $('.select-item').removeClass('select-item_active'); activeSelectIndex = -1 ShowSelectPopup(false, activeSelectIndex); }); var activeSelectOptionIndex = -1; // $('.select-option').on('click', function() { // var index = $(this).index(); // // if (activeSelectOptionIndex != index) { // activeSelectOptionIndex = index; // $('.select-option').removeClass('select-option_active'); // $(this).addClass('select-option_active'); // } // }); var activeSelectNavIndex = -1; $('.select-nav-item').on('click', function() { var index = $(this).index(); if (activeSelectNavIndex != index) { activeSelectNavIndex = index; $('.select-nav-item').removeClass('select-nav-item_active'); $(this).addClass('select-nav-item_active'); } }); function ShowSelectPopup(status, index) { var bodyStyle = $('body').attr('style') || ''; $('.select-popup').hide(); $('.select-popup-mask').hide(); // $('.select-option').removeClass('select-option_active'); $('.select-nav-item').removeClass('select-nav-item_active'); // $('.select-popup').eq(index).find('.select-option').eq(0).addClass('select-option_active'); $('.select-nav-item').eq(0).addClass('select-nav-item_active'); if (status) { $('.select-popup-mask').show(); $('.select-popup').eq(index).show(); $('body').attr('style', 'overflow: hidden;' + bodyStyle); } else { $('.select-popup').eq(index).hide(); $('.select-popup-mask').hide(); bodyStyle = bodyStyle.replace('overflow: hidden;', ''); $('body').attr('style', bodyStyle); } } var activeBannerIndex = 0; })(window, document);