Hi all,
I have this piece of JS code, but it's not working, any idea why.
Or have I made some very obvious error in the code?
I'm not sure if you want to see HTML or CSS?
I have this piece of JS code, but it's not working, any idea why.
Or have I made some very obvious error in the code?
JavaScript:
let sm = document.getElementById("sliderMain");
let ll = document.getElementById("sliderLL");
let l = document.getElementById("sliderL");
let m = document.getElementById("sliderM");
let r = document.getElementById("sliderR");
let rr = document.getElementById("sliderRR");
let ael = addEventListener;
let bgp = style.backgroundPosistion;
let aps = style.animationPlayState;
document.getElementById("btn").ael("click", function() {
if (ll.bgp === 2000) {
ll.bgp = 1000;
l.bgp = 0;
m.bgp = -1000;
r.bgp = -2000;
rr.bgp = -3000;
}
else if (ll.bgp === 1000) {
ll.bgp = 0;
l.bgp = -1000;
m.bgp = -2000;
r.bgp = -3000;
rr.bgp = -4000;
}
else if (ll.bgp === 0) {
ll.bgp = -1000;
l.bgp = -2000;
m.bgp = -3000;
r.bgp = -4000;
rr.bgp = -5000;
}
else if (ll.bgp === -1000) {
ll.bgp = -1000;
l.bgp = -2000;
m.bgp = -3000;
r.bgp = -4000;
rr.bgp = 1000;
}
});
I'm not sure if you want to see HTML or CSS?