Skip to content

Commit

Permalink
Update carousel.js
Browse files Browse the repository at this point in the history
some ecma fixes as suggested by @musicEnfanthen
  • Loading branch information
bwbohl committed Nov 30, 2022
1 parent 39da9a6 commit 904466a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@
* permissions and limitations under the License.
*/

/*jslint browser:true*/

var intervals = [];
let intervals = [];

/*
* sets an interval timer for a submitted carousel
* @param {item} carousel - HTMLcolleciton item.
* @param {Object} carousel - HTMLElement.
* @param {integer} milliseconds – the time per slide.
*/
function animateCarousel(carousel, milliseconds) {
"use strict";
var slides = carousel.getElementsByClassName("carousel-locator"),
slideIndex = 0,
id = carousel.id;
const slides = carousel.getElementsByClassName("carousel-locator");
const id = carousel.id;
var slideIndex = 0;
// iterate over slides
intervals['i' + id] = setInterval(function () {
// make slide at slideIndex visible
Expand All @@ -43,6 +41,6 @@ function animateCarousel(carousel, milliseconds) {

function stopCarouselAnimation(carousel) {
"use strict";
var id = carousel.id;
const id = carousel.id;
clearInterval(intervals['i' + id]);
}

0 comments on commit 904466a

Please sign in to comment.