-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project Feedback #1
Comments
Hey Jessica, re-read criteria 5:
So this means instead of using the Second, the sounds should also trigger when the user clicks or hovers over the button. So make sure the sound plays in both cases. |
Should be fixed now.... I may have done it correctly this time.... sample js code
would this be the proper way of finding and putting it in? |
Yep, you seem to have it down, but there are a few more things we should change here. We also want the sound to play when you hover the mouse over the button. You can do this with the Another thing I would change here is how you define your audio variables. Instead of creating your variables in your event listener, you can put all of your audio variables at the top, and name them based on the sound you'll be using. Then you'll be able to reuse them when you make your And I would give all your button variables unique names too, depending on which sound they'll trigger. Here's an example:
I know that's a lot of information, let me know if you need some help making sense of it all. |
I might have gotten it this time...... but I could be wrong. |
Yeah, you did get the hover working! Technically we wanted both hover and click to trigger the sound, but you've done plenty on this assignment, and I think you understand the material well enough to tackle something new 🙂 |
So, if I wanted to make it clickable, do I put the 'click' next to the 'mousenter'? Like button.addeventlistener('click','mouseenter' ,function()) I'm typing this on mobile but do you understand what I mean? |
@stuartpearman Can you take a look at this? It's hosted here and meets the following criteria:
button
elements are included in your pagemouseenter
event) or clicked on (click
event), a unique sound effect plays from anaudio
element (try the.play()
method) -- you may use these drum kit sounds, create ones from this sound effects generator, or use any other sounds that won't hurt/irritate the people who listen to themaudio
elements are invisible (nocontrols
attribute), so that they can only be played with the buttons.js
The text was updated successfully, but these errors were encountered: