Commit 45b00d60 authored by Sergey's avatar Sergey

Add body product

parent 8f9209b8
//= template/common/header.html
//= template/menu-list-catalog/index.html
//= template/breadcrumb/index.html
//= template/product-title/index.html
//= template/common/footer.html
\ No newline at end of file
'use strict';
(function () {
var checkActive = function (list, elem) {
list.forEach(function (item) {
console.log('Here!');
if(item !== elem){
if(item.classList.contains('active')){
item.classList.remove('active');
}
}
})
};
var tabs = document.querySelector('.menu-list__mainpage');
if(tabs) {
var tab = tabs.querySelectorAll('.menu-list__link');
tab.forEach(function (item, index) {
item.addEventListener('click', function (evt) {
checkActive(tab, item);
if(item.classList.contains('active')){
}else {
evt.preventDefault();
item.classList.toggle('active');
var productSlider = document.querySelectorAll('.product-slider__wrapper');
productSlider[index].classList.add('active');
checkActive(productSlider, productSlider[index]);
}
})
})
}
})();
\ No newline at end of file
// 'use strict';
//
// (function () {
// var checkActive = function (list, elem) {
// list.forEach(function (item) {
// console.log('Here!');
// if(item !== elem){
// if(item.classList.contains('active')){
// item.classList.remove('active');
// }
// }
// })
// };
//
// var tabs = document.querySelector('.menu-list__mainpage');
// if(tabs) {
// var tab = tabs.querySelectorAll('.menu-list__link');
// tab.forEach(function (item, index) {
// item.addEventListener('click', function (evt) {
// checkActive(tab, item);
// if(item.classList.contains('active')){
//
// }else {
// evt.preventDefault();
// item.classList.toggle('active');
// var productSlider = document.querySelectorAll('.product-slider__wrapper');
// productSlider[index].classList.add('active');
// checkActive(productSlider, productSlider[index]);
//
// }
// })
// })
// }
// })();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment