Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

HTML CSS & JavaScript

@Eduardo-Fuentes-Jr

Desktop design screenshot for the Room homepage coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


My second Challenge. Javascript was very difficult for me as I could only find one solution for the scrolling to make the buttons work. I only understood about half of the javascript that I used. Anyways feedback to improve buttons to make a smooth scrolling at a 100% of the div would be great. Thanks! All feedback welcome!

I had difficulty understanding this part of my javascript file: function sideScroll(element,direction,speed,distance,step) {}

Community feedback

Dawid 440

@dwddgsz

Posted

Hello. This function need 5 params. 'step' is responsible for smoothness, it's value in pixels that defines single movement, 'distance' defines overall scroll value in pixels. In your case it's 30 moves for one scroll (300px distance / 10 px for each step). Delay of each step is defined by 'speed' (read about setInterval). At the end of the scroll interval is getting cleared. 'element' and 'direction' are pretty straightforward I guess. I hope it helps

0

@Eduardo-Fuentes-Jr

Posted

@dwddgsz Hi! Yes this does help out a lot. I was confused with what speed distance and step did and I messed around with the numbers and researched but couldn't figure it out but it makes sense now! Thank you!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord