I mentioned that before.
No, the playbutton click handler function.
function upTo(evt.target, ".playButton") {
var button = getPlayButton(evt.target);
togglePlayButton(button);
}
You said to remove this:
getPlayButton
Thatâs right, yes I did. And to use the upTo function in its place.
show(wrap.querySelector(".myLink"));
will become:???
show(links.querySelector(".links"));
That all depends on what myLink was. Is it the same as what .links now is?
So is .myLink the same as what .links is now used for?
I would say, yes it is.
document.querySelector(".links").classList.add("hide");
function show(el) {
el.classList.remove("hide");
}
function hide(el) {
el.classList.add("hide");
}
function togglePlayButton(button) {
var links = upTo(button, "links");
var player = button.querySelector("audio");
var play = button.querySelector(".play");
var pause = button.querySelector(".pause");
button.classList.add("playing");
hide(button.querySelector(".initial"));
show(links.querySelector(".links"));
player.volume = 1.0;
if (player.paused) {
hide(play);
show(pause);
player.play();
} else {
show(play);
hide(pause);
player.pause();
}
}
This is invalid, I canât use upTo for this since thereâs nowhere to go up to.
Thereâs only links.
var links = upTo(button, "links");
or am I wrong?
Why is it invalid? The button is inside of the links element, so starting from the button itâs easy to find the links element. It has a classname of âlinksâ, so the â.linksâ will find that element.
var links = upTo(button, ".links");
If instead of â.linksâ to find a class name, you used a selector of âlinksâ without the fullstop, that would try and look for a <links>
element instead which is clearly not desired.
What do I do next?
Links:.style working version:
Check the browser console.
Yes, I keep throwing you back to that because itâs so damned useful.
upTo(evt.target, ".playButton") {
SyntaxError: missing ; before statement
[Learn
It looks like you removed the word function
from that line when you shouldnât have.
SyntaxError: missing ) after formal parameters
_display:132:22
it will not show me where the line is.
keeps saying:
{âerrorâ: âPlease use POST requestâ}