Skip to content

Comments

added task JS#5

Open
Ge5akl wants to merge 1 commit intomasterfrom
JS_Task
Open

added task JS#5
Ge5akl wants to merge 1 commit intomasterfrom
JS_Task

Conversation

@Ge5akl
Copy link
Owner

@Ge5akl Ge5akl commented Jan 17, 2019

Added task

</div>
</div>
<a class="prev" onclick="minusSlide()">&#10094;</a>
<a class="next" onclick="plusSlide()">&#10095;</a>

Choose a reason for hiding this comment

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

сделай это лучше в js файле с помощью addEventListener

}
for (i = 0; i < slides.length; i++) {
// if (slides[i].style.display === 'block') {
// }

Choose a reason for hiding this comment

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

удали неиспользуемый код

// if (slides[i].style.display === 'block') {
// }
console.log(i);
slides[i].style.display = "none";

Choose a reason for hiding this comment

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

сделай проверку в if блоке на то если элемент активен и потом делай display = 'none'
не очень хорошо выполнять ненужные действия впустую

// }
console.log(i);
slides[i].style.display = "none";
dots[i].className = dots[i].className.replace(" active", "");

Choose a reason for hiding this comment

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

используй методы у classList вместо работы с методами строки
можно использовать add, remove, toggle, etc.

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