-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
NW6| Bakhat Begum | MODULE-JS2| Js2 slideshow/week 4 | Week-4 #219
base: main
Are you sure you want to change the base?
NW6| Bakhat Begum | MODULE-JS2| Js2 slideshow/week 4 | Week-4 #219
Conversation
✅ Deploy Preview for cute-gaufre-e4b4e5 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job, you've managed to get all the strech functionality, including making sure that the auto-forward/backward buttons cannot be pressed multiple times. The code could do with some simplifying, use fewer array methods like shift and push, look out for repeated code.
|
||
document.getElementById('next').addEventListener('click', (event) => { | ||
img_list.push(img_list.shift()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting use of array methods to access the image and add it to the document. Consider simplifying by accessing the desired element in the array with bracket notation
|
||
let autoForwardButton = false; | ||
setInterval(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have a set interval, consider refactoring this code into the same place.
Learners, PR Template
Self checklist
Changelist
the task is to caracole images and have control images by buttons. when the user clicks auto-forward the image should change forward after every 5 seconds and when the user clicks the auto-backwards button, the image should change backwards after every 5 seconds. Secondly, when the user clicks the stop button it must stop the image caracole from auto mode. Lastly, image movement must be controlled by forward and backward buttons.
Questions