jQuery Slider (Slick)

Slide 1
Slide 2
Slide 3
Slide 4
Slide 5

What’s happening on this page?

This slider uses a classic “jQuery-era” approach: we include jQuery, we include a plugin (Slick), and then we run a short setup script that tells Slick to turn our HTML into a carousel.

1) The HTML (structure)

2) The CSS (appearance)

3) The JavaScript (behavior)

The file slider-init.js is where Slick is activated. It usually looks like this:

$(function () {
  $(".slider").slick({
    dots: true,
    arrows: true,
    infinite: true,
    speed: 350,
    autoplay: false
  });
});

Customization options to try

File: slider-init.js
These options go inside $(".slider").slick({ ... }). Try turning ONE option on/off at a time so you can see what it changes.

Starter set (safe + useful)

// Show multiple slides at once (thumbnails / galleries)
slidesToShow: 2,
slidesToScroll: 1,

// Cross-fade instead of sliding (works best with slidesToShow: 1)
fade: true,

// Allow dragging with mouse / touch
draggable: true,
swipe: true,

Autoplay (use carefully)

// Autoplay can be distracting. Use with care.
autoplay: true,
autoplaySpeed: 2000,
pauseOnHover: true,

Height behavior (can cause page jumping)

// Makes slider height match each slide’s content.
// WARNING: can cause the page to jump up/down between slides.
adaptiveHeight: true,

Troubleshooting checklist

Why teach this version?

This “plugin approach” is historically important and still used in many older codebases. It also shows the tradeoff: you get lots of features quickly, but you add dependency files and rely on someone else’s code.