Dovah
Dovah
KPCKevin Powell - Community
Created by Dovah on 12/25/2024 in #front-end
'touchend' event triggering RightMouseButton?
Don't think they matter, but justso that you have it if needed
5 replies
KPCKevin Powell - Community
Created by Dovah on 12/25/2024 in #front-end
'touchend' event triggering RightMouseButton?
This is the incrtement inside of touchend event
5 replies
KPCKevin Powell - Community
Created by Dovah on 12/25/2024 in #front-end
'touchend' event triggering RightMouseButton?
function totalPrice() {
const cartTotalItemPrice = document.querySelectorAll(".total-item-price-span")
const cartItemsNumber = document.querySelector(".cart-items-number")

cartItemsNumber.innerText = cartTotalItemPrice.length;

let fullPrcie = 0;
for(let i=0;i<cartTotalItemPrice.length;i++) {
let price = Number(cartTotalItemPrice[i].innerText);
fullPrcie += price;
totalPriceSpan.innerText = fullPrcie.toFixed(2);
}
}
function incrementAmmount() {
const itemCartName = document.querySelectorAll(".item-name");
const itemAmmountSpan = document.querySelectorAll(".item-ammount-span")
const totalItemPrice = document.querySelectorAll(".total-item-price-span")

for(let i=0;i<itemCartName.length;i++) {
if(itemCartName[i].innerText === cardName.innerText) {
itemAmmountSpan[i].innerText = itemAmmount;
totalCartItemPrice = Number(Number(itemAmmount)*Number(itemPrice)).toFixed(2);
totalItemPrice[i].innerText = totalCartItemPrice;
totalPrice();
}
}
}
function totalPrice() {
const cartTotalItemPrice = document.querySelectorAll(".total-item-price-span")
const cartItemsNumber = document.querySelector(".cart-items-number")

cartItemsNumber.innerText = cartTotalItemPrice.length;

let fullPrcie = 0;
for(let i=0;i<cartTotalItemPrice.length;i++) {
let price = Number(cartTotalItemPrice[i].innerText);
fullPrcie += price;
totalPriceSpan.innerText = fullPrcie.toFixed(2);
}
}
function incrementAmmount() {
const itemCartName = document.querySelectorAll(".item-name");
const itemAmmountSpan = document.querySelectorAll(".item-ammount-span")
const totalItemPrice = document.querySelectorAll(".total-item-price-span")

for(let i=0;i<itemCartName.length;i++) {
if(itemCartName[i].innerText === cardName.innerText) {
itemAmmountSpan[i].innerText = itemAmmount;
totalCartItemPrice = Number(Number(itemAmmount)*Number(itemPrice)).toFixed(2);
totalItemPrice[i].innerText = totalCartItemPrice;
totalPrice();
}
}
}
5 replies
KPCKevin Powell - Community
Created by Dovah on 12/25/2024 in #front-end
'touchend' event triggering RightMouseButton?
This is the 'touchstart' and 'touchend' function
5 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
👍
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
@Jochem Thanks for help as well.
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
Ok that should be it, it works fine I think. @Tok124 (CSS Nerd) The
interval = setTimeout(() => {
interval = setInterval(action, 100);
}, 300)
interval = setTimeout(() => {
interval = setInterval(action, 100);
}, 300)
part where you put timeout in interval as well helped a lot since I was not doing it and double click would triger the interval function due to the timeout. xD
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
I did say that clearly
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
Just click + button with both mousebuttons
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
It does not need to be hit with both. But when it is hit with both, it does that. Codepen that person above linked has the same problem
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
xD
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
if(e.button === 2) {return;} else {}
if(e.button === 2) {return;} else {}
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
Ok it works with
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
an goes into infinite count
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
Oh it still missfires even with that code
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
if(e.button === 0) {}
if(e.button === 0) {}
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
But isn't limiting button to only be clicked by LMB a fix? Why is it crazy?
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
But what if they do by accident and the counter on the shop goes wild and they pay for 150+ items because they panicked? xD
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
but click it with both LMB and RMB at the same time
28 replies
KPCKevin Powell - Community
Created by Dovah on 12/24/2024 in #front-end
Increment number by holding a button with mouse click or screen tap?
No double click
28 replies