Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lecongthanh3584 committed Feb 11, 2022
1 parent a272654 commit 4018fe7
Show file tree
Hide file tree
Showing 9 changed files with 3,405 additions and 49 deletions.
2 changes: 2 additions & 0 deletions Javascript/jquery-3.6.0.min.js

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions Javascript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ window.onscroll = () =>{
navbar.classList.remove('open');
}

var myIndex = 0;
carousel();
function carousel() {
const x = document.getElementsByClassName("js-slider");
for (let i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 4000);
}
// var myIndex = 0; /**Đây là code chạy slider không vuốt được */
// carousel();
// function carousel() {
// const x = document.getElementsByClassName("js-slider");
// for (let i = 0; i < x.length; i++) {
// x[i].style.display = "none";
// }
// myIndex++;
// if (myIndex > x.length) {myIndex = 1}
// x[myIndex-1].style.display = "block";
// setTimeout(carousel, 4000);
// }

$('.slider-contain').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 3000,
});

Loading

0 comments on commit 4018fe7

Please sign in to comment.