Skip to content

Commit

Permalink
Fix override class names on li bug (closes #98)
Browse files Browse the repository at this point in the history
  • Loading branch information
nir9 committed Sep 29, 2024
1 parent 147a82b commit 9117a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions itemslide.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function isOutBoundaries()
function changeActiveSlideTo(i)
{
var oldSlide = carousel.element.children[carousel.vars.currentIndex || 0];
oldSlide.className = "";
oldSlide.classList.remove("itemslide-active");

carousel.element.children[i || 0].className = " itemslide-active";
carousel.element.children[i || 0].classList.add("itemslide-active");

if (i != carousel.options.currentIndex) {
carousel.vars.currentIndex = i;
Expand Down Expand Up @@ -259,7 +259,7 @@ function slideout()
if (carousel.element.savedSlideIndex == carousel.vars.currentIndex) {
var firstMoveSlide = document.querySelector(itemslideMove + ' :nth-child(1)');
if (firstMoveSlide) {
firstMoveSlide.className = "itemslide-active";
firstMoveSlide.classList.add("itemslide-active");
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "itemslide",
"version": "2.0.0",
"version": "2.0.1",
"description": "A simple and beautiful vanilla JavaScript touch carousel",
"main": "itemslide.js",
"scripts": {
Expand Down

0 comments on commit 9117a70

Please sign in to comment.