Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

BakhatBegum
Copy link

@BakhatBegum BakhatBegum commented Jan 23, 2024

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

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

Copy link

netlify bot commented Jan 23, 2024

Deploy Preview for cute-gaufre-e4b4e5 ready!

Name Link
🔨 Latest commit 347b164
🔍 Latest deploy log https://app.netlify.com/sites/cute-gaufre-e4b4e5/deploys/65afee80f8ee240008e0b560
😎 Deploy Preview https://deploy-preview-219--cute-gaufre-e4b4e5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@Honestocean Honestocean left a 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());

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(() => {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants