Skip to content

Conversation

@dashaaaa21
Copy link

No description provided.

Copy link

@acadavid acadavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dashaaaa21 Great job! Almost there. Some minor adjustments to make.

-----------------------------------------------------------------------------*/
//cspell: enable

function createBookList(books) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job here!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tkank you!

const currentTime = hours + ':' + minutes + ':' + seconds;
const timeElement = document.getElementById('time');
if (timeElement) {
timeElement.textContent = currentTime;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the value displayed in the console but not on the page itself, what could be going on?
Screenshot 2025-09-19 at 16 47 33

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, I have already changed this assignment

-----------------------------------------------------------------------------*/
function catWalk() {
// TODO complete this function
const img = document.querySelector('img');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cat needs to stop in the middle, dance, and then continue walking. Want to give it another try?

catwalk

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, I have already changed this assignment

Copy link

@acadavid acadavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I left a final suggestion for you to simplify the code and get rid of an unnecessary method. Would you mind changing that? But I'll approve your homework already 👍

if (img.complete && img.naturalWidth > 0) {
timer = setInterval(step, 50);
} else {
img.addEventListener('load', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you're using load here, but you already have window.addEventListener('DOMContentLoaded', catWalk);. DOMContentLoaded awaits for the DOM elements (p, spans, etc) to be loaded, but not for the rest of the elements to be loaded like images. load does wait for them as I see you're trying to do here, also by checkingimg.complete.

Can you simplify the code to avoid the startWhenReady() method? You can modify the eventListener for catWalk :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, I’ve already changed exercise 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants