Manda-Shop
let elem = document.getElementsByClassName('filter-div')[0] let elembtn = document.getElementById("filter-btn") let elem1 = document.getElementsByClassName('sortieren-div')[0] let elembtn1 = document.getElementById("sortieren-btn") let elemdesktop = document.getElementsByClassName('filter-div')[0] let categorydiv = document.getElementsByClassName('category-div')[0].parentElement.parentElement if (elemdesktop){ elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); } let curopen = 0; /*function testThis(gid){ console.log(curopen ) elem1.classList.remove("active") elem.classList.remove('active') if ( elemdesktop.parentElement.parentElement.style.display === "block" || elemdesktop.parentElement.parentElement.style.display === "" ) { elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); if (gid == 1 && curopen == 2){ curopen = 0 testThis(1) } else if (gid == 2 && curopen == 1){ curopen = 0; testThis(2); } else { curopen = 0 } } else { if (gid == 1){ elem.classList.add('active') elem1.classList.remove("active") curopen = 1; elemdesktop.parentElement.parentElement.style.display = "block"; categorydiv.style.flex = "0 0 75%"; $(categorydiv).css("max-width", "75%"); } else if (gid == 2){ elemdesktop.parentElement.parentElement.style.display = "block"; elem1.classList.add('active') curopen = 2 } } openStuff() }*/ function openFilterMenu(){ if ( elemdesktop.parentElement.parentElement.style.display === "block" || elemdesktop.parentElement.parentElement.style.display === "" ) { elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); } else { elem.classList.add('active') elemdesktop.parentElement.parentElement.style.display = "block"; categorydiv.style.flex = "0 0 75%"; $(categorydiv).css("max-width", "75%"); } openStuff() } function openSortMenu(){ if (elem1.classList.contains('active')){ elem1.classList.remove('active') } else { elem1.classList.add('active') } } elembtn.addEventListener("click", function(){ openFilterMenu(1) }) function openStuff(){ let elems = document.getElementsByClassName("owl-loaded"); for (let i1 = 0; i1 < elems.length; i1++) { elems[i1].style.display = "none"; } setTimeout(function() { for (let i1 = 0; i1 < elems.length; i1++) { elems[i1].style.display = "block"; } }, 600); } elembtn1.addEventListener("click", function(){ //openFilterMenu(2) openSortMenu() })
let li_elements = document.getElementsByTagName("li") for (let i = 0; i < li_elements.length; i++){ if (li_elements[i].textContent.includes("SALE")){ console.log(li_elements[i].childNodes[0]) li_elements[i].childNodes[0].style.color = "red"; } } window.onload = function(e){ let elements = document.getElementsByClassName("cmp-product-thumb") $(".category-item-placeholder").css("min-height", elements[0].offsetHeight) let elems = document.getElementsByClassName("colorrechteck"); console.log(elems) for (let i_1 = 0; i_1 < elems.length; i_1++){ let allclasses = elems[i_1].className.split(" ") console.log(allclasses) for (let i1= 0; i1 < allclasses.length; i1++){ if (allclasses[i1].includes("rechteck-")){ let sp = allclasses[i1].split("-"); //elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", '') elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", `
`) elems[i_1].children[0].children[1].children[0].children[0].innerHTML = " " elems[i_1].style.backgroundColor= "#"+sp[1]; elems[i_1].style.padding= "10px" } } } } if (elemdesktop){ elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); }