theme updates
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
<p id="selected-text"></p>
|
||||
<p id="selected-text">Includes free shipping and lockbox! </p>
|
||||
<p class="fee-text">{{product.fee_text}}</p>
|
||||
</div>
|
||||
<div class="col-4 col-lg-6 col-md-4 p-3">
|
||||
@@ -166,11 +166,11 @@ for (i = 0; i < l; i++) {
|
||||
if (s.options[k].innerHTML == this.innerHTML) {
|
||||
s.selectedIndex = k;
|
||||
h.innerHTML = this.innerHTML;
|
||||
if (this.innerHTML === "Annually | $34.95" || this.innerHTML === "Annually | $27.95" || this.innerHTML === "Annually | $44.95") {
|
||||
if (this.innerHTML === "Annually | $34.95" || this.innerHTML === "Annually | $27.95" || this.innerHTML === "Annually | $44.95" || this.innerHTML === "Annually | $39.95") {
|
||||
document.getElementById("selected-text").innerHTML = "Includes free shipping and lockbox! ";
|
||||
} else if (this.innerHTML === "Semi-Annually | $49.95" || this.innerHTML === "Semi-Annually | $39.95" || this.innerHTML === "Semi-Annually | $29.95") {
|
||||
} else if (this.innerHTML === "Semi-Annually | $49.95" || this.innerHTML === "Semi-Annually | $39.95" || this.innerHTML === "Semi-Annually | $29.95" || this.innerHTML === "Semi-Annually | $44.95" || this.innerHTML === "Semi-Annually | $37.95") {
|
||||
document.getElementById("selected-text").innerHTML = "Includes free shipping!";
|
||||
} else if (this.innerHTML === "Monthly | $49.95" || this.innerHTML === "Monthly | $39.95" || this.innerHTML === "Monthly | $29.95") {
|
||||
} else if (this.innerHTML === "Monthly | $49.95" || this.innerHTML === "Monthly | $39.95" || this.innerHTML === "Monthly | $29.95" || this.innerHTML === "Monthly | $44.95") {
|
||||
document.getElementById("selected-text").innerHTML = "";
|
||||
|
||||
}
|
||||
@@ -182,34 +182,32 @@ for (i = 0; i < l; i++) {
|
||||
b.appendChild(c);
|
||||
}
|
||||
x[i].appendChild(b);
|
||||
a.addEventListener("click", function(e) {
|
||||
e.stopPropagation();
|
||||
closeAllSelect(this);
|
||||
this.nextSibling.classList.toggle("select-hide");
|
||||
this.classList.toggle("select-arrow-active");
|
||||
});
|
||||
a.addEventListener("click", function(e) {
|
||||
e.stopPropagation();
|
||||
closeAllSelect(this);
|
||||
var items = this.nextElementSibling;
|
||||
items.classList.toggle("select-hide");
|
||||
this.classList.toggle("select-arrow-active");
|
||||
});
|
||||
|
||||
// Close the dropdown when clicking outside of it
|
||||
document.addEventListener("click", function(e) {
|
||||
closeAllSelect(null);
|
||||
});
|
||||
}
|
||||
|
||||
function closeAllSelect(elmnt) {
|
||||
var x, y, k, xl, yl, arrNo = [];
|
||||
x = document.getElementsByClassName("select-items");
|
||||
y = document.getElementsByClassName("select-selected");
|
||||
xl = x.length;
|
||||
yl = y.length;
|
||||
for (k = 0; k < yl; k++) {
|
||||
if (elmnt == y[k]) {
|
||||
arrNo.push(k)
|
||||
} else {
|
||||
y[k].classList.remove("select-arrow-active");
|
||||
}
|
||||
}
|
||||
for (k = 0; k < xl; k++) {
|
||||
if (arrNo.indexOf(k) < 0) {
|
||||
x[k].classList.add("select-hide");
|
||||
var x = document.getElementsByClassName("select-items");
|
||||
var y = document.getElementsByClassName("select-selected");
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
if (y[i] && (elmnt !== y[i].parentNode)) {
|
||||
x[i].classList.add("select-hide");
|
||||
y[i].classList.remove("select-arrow-active");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("click", closeAllSelect);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user