Use a semantic list of images in a horizontally scrollable track, add CSS Scroll Snap for reliable alignment, and layer JavaScript controls on top only when you need them. This approach works with touch, trackpads, mouse wheels, keyboards and assistive technology without making JavaScript responsible for basic scrolling. The complete example below includes previous/next buttons, slide announcements, optional autoplay, responsive sizing and reduced-motion handling.
What a sliding image gallery is
A sliding image gallery is a carousel: a set of related slides shown in sequence while the visitor moves forward or backward with a swipe, scroll gesture, buttons or picker controls. Image galleries are a common carousel use case in W3C WAI guidance.
The most resilient implementation has three layers:
- Semantic HTML: a labeled region containing a list of slides and real
<img>elements. - CSS: a horizontal overflow track with
scroll-snap-typeandscroll-snap-align. - JavaScript: optional controls that scroll to a slide, track the current slide and announce changes.
Native scrolling remains usable if JavaScript fails, while the controls add convenience for people who prefer explicit navigation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- Features an 8 Megapixel camera for capturing Ultra High Definition live images up to 3264 x 2448 pixels
- High frame rate for lag-free live streaming – streams at up to 30 fps at full HD, and up to 15 fps at 3264 x 2448 pixel
- Fast focusing speed helps minimize interruptions for frequent switching between different materials; features Sony CMOS Image Sensor for exceptional noise reduction and color Reproduction – great for capturing in dimly lit environments
- Designed and made in Taiwan. Multi-jointed stand offers a simple fix for tightening loose joints caused by heavy daily use.Max Shooting Area:13.46 inch x 10.04 inch
- Works with a variety of software and applications on Mac, PC and Chromebook that allows you to use it in different ways. System Requirements - Mac Intel Core i5 CPU 2.5 GHz or higher, OS X 10.10 or higher, Solid-state drive, and 200MB of free hard disk space, 256MB of dedicated video memory (For lag-free live streaming up to 1920 x 1080, and video recording of 1920 x 1080). Windows Recommended Requirements - Microsoft Windows 10,Intel Core i5 CPU 3.40 GHz or higher, 4 GB RAM, 200MB of free hard disk space, 256MB of dedicated video memory (For lag-free live streaming up to 1920 x 1080, and video recording of 1920 x 1080)
Complete implementation
1. Semantic HTML
Give the gallery a visible heading and use that heading to label the region. Each slide is a list item. Replace the sample image URLs and alternative text with content that describes the actual image and its purpose.
<section class="gallery" aria-labelledby="gallery-title">
<h2 id="gallery-title">Product details</h2>
<div class="gallery-viewport">
<ul class="gallery-track" id="gallery-track">
<li class="gallery-slide" id="slide-1">
<img src="images/front.jpg" alt="Front view of the blue travel backpack">
</li>
<li class="gallery-slide" id="slide-2">
<img src="images/inside.jpg" alt="Inside compartments of the blue travel backpack">
</li>
<li class="gallery-slide" id="slide-3">
<img src="images/straps.jpg" alt="Padded shoulder straps on the blue travel backpack">
</li>
</ul>
</div>
<div class="gallery-controls">
<button type="button" id="gallery-prev" aria-label="Previous image">Previous</button>
<span id="gallery-status" role="status" aria-live="polite">Image 1 of 3</span>
<button type="button" id="gallery-next" aria-label="Next image">Next</button>
</div>
</section>
Do not put meaningful images in CSS backgrounds: screen readers cannot use their alternative text. If an image is purely decorative, use an empty alt="" instead of repeating nearby text.
2. CSS scrolling and snap points
The viewport hides horizontal overflow; the track remains a single row. scroll-snap-type: x mandatory asks the browser to settle on a slide after a gesture. Use proximity instead if you want users to stop between slides during free scrolling.
.gallery {
max-width: 70rem;
margin-inline: auto;
padding: 1rem;
}
.gallery-viewport {
overflow-x: auto;
overscroll-behavior-x: contain;
scroll-behavior: smooth;
scrollbar-width: thin;
}
.gallery-track {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
gap: 1rem;
margin: 0;
padding: 0;
list-style: none;
scroll-snap-type: x mandatory;
}
.gallery-slide {
min-width: 0;
scroll-snap-align: start;
scroll-snap-stop: always;
}
.gallery-slide img {
display: block;
width: 100%;
height: auto;
aspect-ratio: 16 / 9;
object-fit: cover;
border-radius: .5rem;
}
.gallery-controls {
display: flex;
align-items: center;
justify-content: center;
gap: .75rem;
margin-top: .75rem;
}
.gallery-controls button {
min-width: 6rem;
min-height: 2.75rem;
}
@media (min-width: 48rem) {
.gallery-track { grid-auto-columns: 70%; }
}
@media (prefers-reduced-motion: reduce) {
.gallery-viewport { scroll-behavior: auto; }
}
The mobile rule shows one slide at a time; the wider rule exposes part of the next slide as a visual cue. If every slide must be fully visible, keep grid-auto-columns: 100% at all widths. Test the chosen width with real content, not only empty placeholders.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match3. JavaScript controls and announcements
This script finds the nearest slide from the track’s scroll position, scrolls by index, disables buttons at the ends and updates a polite live region. It uses buttons rather than clickable non-semantic elements, so keyboard activation works by default.
Rank #2
- Document camera with Image reversal function: The image reversal function can be realized through the button (no need to pass the software). When video chatting or picture output, the picture can be freely reversed left and right, up and down; The PAKOTOO document camera connects the computer via USB 2.0 cable, it does not support zoom and HDMI features, nor it does compatible with iPad.
- Document camera for teachers with 3 levels of brightness adjustment and 10 levels of exposure adjustment: The brightness function can be realized by buttons to ensure that you can get clearer images. It can also realize the Selfie fill light function in dark and bright environments
- Document camera for classroom with Foldable: Embedded design, takes up little space after folding, and is easy to carry; multi-joint supports multi-angle free rotation, which can better capture 2D and 3D objects. Maximum coverage area: 16.5" x 11.6" in (A3 paper)
- USB document camera with autofocus: 2448P high-definition document cameras, press the focus (AF) button once, and the document camera will automatically focus once. Move the object under the lens, the image will not be blurred. Macro captures objects as small as 3.94"
- Important: PAKOTOO Document camera is not plug and play. You need to select "USB Camera" in the system that comes with your computer. The document camera is equipped with a USB-C cable, which can be directly used with devices with USB-C interface such as MacBook. Compatible with Windows PCS, Macs and Chromebooks, works with Tiktok, Google Meet, Skyp-Microsoft Teams, Zoom; If you encounter any problems during the use of the product, or the computer does not recognize the camera, please be sure to contact our friendly support team for a quick solution.
const track = document.querySelector('#gallery-track');
const slides = [...track.querySelectorAll('.gallery-slide')];
const previous = document.querySelector('#gallery-prev');
const next = document.querySelector('#gallery-next');
const status = document.querySelector('#gallery-status');
let current = 0;
function setCurrent(index, move = true) {
current = Math.max(0, Math.min(index, slides.length - 1));
if (move) {
slides[current].scrollIntoView({
behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth',
block: 'nearest',
inline: 'start'
});
}
previous.disabled = current === 0;
next.disabled = current === slides.length - 1;
status.textContent = `Image ${current + 1} of ${slides.length}`;
}
previous.addEventListener('click', () => setCurrent(current - 1));
next.addEventListener('click', () => setCurrent(current + 1));
let scrollTimer;
track.addEventListener('scroll', () => {
clearTimeout(scrollTimer);
scrollTimer = setTimeout(() => {
const left = track.scrollLeft;
let nearest = 0;
let distance = Infinity;
slides.forEach((slide, index) => {
const difference = Math.abs(slide.offsetLeft - left);
if (difference < distance) {
distance = difference;
nearest = index;
}
});
if (nearest !== current) setCurrent(nearest, false);
}, 80);
});
setCurrent(0, false);
The timeout prevents an announcement on every intermediate scroll event. For very large galleries, replace the offset loop with an IntersectionObserver so the browser reports which slide is mostly visible.
Adding picker dots or thumbnails
Picker controls are optional. If you add them, use buttons with visible labels or an accessible name such as “Show image 2 of 3.” Mark the selected control with aria-current="true" (or an equivalent selected state) and update it whenever the current slide changes. Keep the buttons in a logical tab order and do not create a second, conflicting way to announce the same state.
Thumbnail images need their own useful alternative text. If the thumbnail’s visible label already identifies the image, its alt can be empty to avoid duplicate announcements.
Autoplay: only when visitors can control it
Automatic rotation is often unnecessary and can make text hard to read. W3C WAI states: “Users must be able to pause carousel movement because it can be too fast or distracting, making text hard to read.” If rotation serves a clear purpose:
- Place a clearly labeled Pause/Play button before the rotating content.
- Stop rotation when keyboard focus enters the gallery.
- Stop rotation while the pointer hovers over it.
- After focus has entered, require an explicit user action to restart; do not silently resume.
- Respect
prefers-reduced-motion: reduceby starting paused. - Do not move focus automatically when a timer changes slides.
A minimal timer can call setCurrent((current + 1) % slides.length) every few seconds, but only after implementing the pause, focus, hover and reduced-motion rules above. Never hide off-screen slides from the accessibility tree in a way that leaves their text exposed without context; follow the WAI carousel pattern for slide visibility and labeling.
Rank #3
- AIKOR 2MP 3-in-1 USB Webcam, Document Camera and Visualiser: It can be used as a webcam for video chats and teleconferences. The rotating lens allows for image clarity adjustment during live demonstrations. Featuring a flexible 0.47-inch diameter hose design, it can be adjusted to any angle.
- Portable Document Camera: This lightweight document camera weighs only 1.1 pounds, extends up to 20.4 inches in height, and features a 360-degree adjustable and rotatable camera for capturing images and videos from multiple angles. It can present objects of varying sizes and positions, and the weighted base ensures excellent operational stability. This document camera combines portability with high performance, making it an ideal choice for educators and professionals.
- Manual focus webcam: This document camera uses precise manual focus to avoid the repeated unclear focus caused by auto focus. It can achieve virtualized real-life effect shooting when needed, supports 1080P full HD resolution, and refresh rate up to 30 frames per second. Manual focus helps to stabilize the focus and restore the true color and texture.
- Versatile Document Camera: Equipped with a CMOS image sensor and built-in sealed silicon microphone to reduce noise and improve sound quality, achieving excellent noise reduction and color reproduction. Suitable for education, home and office (video conferencing, online teaching, online tutoring, home office, video calls, making teaching videos, animations, games and live demonstrations).
- High compatibility: The visualiser document camera comes with a USB-C cable and can be used directly with devices equipped with a USB-C port (such as MacBook). Compatible with Windows PC, Mac and Chromebook, and can be used with software such as TikTok, Google Meet, Skype, etc. It can be used with all major web conferencing software applications (Zoom, Google Meet, etc.).
Responsive images and loading performance
Choose an appropriate source
Use srcset and sizes so phones do not download desktop-sized files. Set a stable width and height (or an aspect-ratio) to prevent layout shifts. Compress photographs and prefer WebP or AVIF when your browser support policy allows them.
<img
src="images/front-960.webp"
srcset="images/front-480.webp 480w, images/front-960.webp 960w, images/front-1440.webp 1440w"
sizes="(min-width: 48rem) 70vw, 100vw"
width="1440"
height="810"
alt="Front view of the blue travel backpack">
Load only what the page needs
Keep the first image eager because it is immediately visible. Add loading="lazy" to later slides when a gallery contains many or very large images. Do not lazy-load the image that is visible at first paint. Preload only a likely next image if testing shows a real benefit; excessive preloads compete with the main page.
Accessibility and keyboard checklist
- The region has a visible heading and an
aria-labelledbyrelationship. - Every informative image has accurate alternative text.
- Previous, next, picker and pause controls are native buttons.
- Controls have a visible focus indicator and sufficient hit area.
- Slide changes are communicated through a concise status message.
- Users can operate the gallery with Tab and Enter/Space as well as touch.
- There is no forced focus movement when a slide changes.
- Autoplay can be paused, stops on focus and hover, and honors reduced motion.
- At narrow widths, content is not clipped vertically or horizontally except inside the intended viewport.
Test with a keyboard, a screen reader, touch, a trackpad, zoom at 200 percent and a narrow viewport. Verify that focus never lands on content that is visually hidden but still announced. Also test with JavaScript disabled: the scrollable list should remain usable.
Choosing an implementation approach
| Approach | Best for | Trade-offs |
|---|---|---|
| Scrollable list plus CSS Scroll Snap | A simple gallery that needs native touch and scrolling | You must test snap behavior, responsive widths and target browsers. |
| Newer declarative CSS carousel features | Projects that want browser-provided controls or markers | Support is browser-specific. Chrome for Developers describes CSS Overflow 5 carousel features from Chrome 135; verify every target browser before relying on them. |
| JavaScript-enhanced controls | Previous/next buttons, pickers, announcements or custom state | You must keep state, keyboard behavior and announcements synchronized. |
Progressive enhancement is the safe default: build the semantic scrolling list first, then add newer CSS or JavaScript where supported.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common failures
The track does not slide
Inspect the track and confirm it has display: grid (or a flex row), that slides cannot shrink below their intended width, and that the viewport—not the whole page—has overflow-x: auto. Check that images have loaded and that no parent has overflow: hidden clipping the wrong element.
Rank #4
- [Crystal-Clear Imaging and Smooth Video Streaming] 8 Megapixel Ultra-High definition SONY camera captures live images at up to 3264 x 2448 pixels with lag-free video streaming at 30 fps across all resolutions.
- [Your Space-Saving Multi-Joint Camera] Experience the durability of our multi-joint design while enjoying a generous viewing size of 14.72 x 11 inches. This compact camera is perfect for your desktop set up.
- [Powerful Features, Crisp Image] Featuring LED light, and an anti-glare sheet for exposure challenges in varying lighting. 7-segment brightness control, image flip, and built-in mic ensure top-notch performance. Autofocus lens and macro capability (capturing objects as close as 3.9 inches).
- [Feature-Packed INSWAN Documate Software] The bundled full-function INSWAN Documate software offers digital zoom, image annotation, hue adjustment, image rotation/flip, video recording, snapshots and other useful features. Download the latest version for free and access tutorial videos!
- [Plug-n-Play & High Compatibility for Effortless Conferencing] The INS-1 comes with a USB-A cable for instant plug-and-play operation. Seamlessly works with Documate and other webinar software on PC (Windows 7/8/10/11), Mac (OS13.5 or higher), iPad (OS 17 or higher; must have a USB-C port) , Chromebook (38.0 or higher). Designed and made in Taiwan.
Snapping feels jerky or lands between images
Make each slide’s width deterministic, give each slide scroll-snap-align, and avoid changing image dimensions after load. Use proximity instead of mandatory if users need to stop freely. Re-test after changing the desktop column width.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Buttons and scrolling disagree about the current image
Update state from both button actions and user scrolling. Debounce the scroll handler, calculate the nearest slide from its offset, and clamp the index at zero and the last slide. Recalculate after a resize if slide widths change.
Screen readers announce too much
Use one labeled region, concise image alternative text and one live status message. Do not place every hidden slide’s long caption in an always-live region. Follow the WAI pattern for how off-screen slides are exposed.
Autoplay causes complaints
Add a prominent pause control, stop on focus and hover, disable it for reduced-motion users, and require a user action to restart after focus. Removing autoplay entirely is often the better design.
Images are slow or layout shifts occur
Provide dimensions or an aspect ratio, serve responsive compressed files, lazy-load later slides, and inspect the network panel for unexpectedly large originals or duplicate downloads.
Recommended Free Tools
Best Value
- 8MP visualiser with adjustable image reversal: In video chat or image output, the image can be freely adjusted left/right and up/down; you can also manually adjust the reversed image that appears in the device to a normal image. The first usb camera that can manually adjust image reversal
- Adjustable Image Brightness: the usb document camera has brightness buttons, you can manually adjust the image brightness with 10 degree, to make sure that you can get the clear image. 3 levels of brightness adjustable, which can eliminate shooting problems under difficult lighting conditions, allowing you to capture objects in dark and bright environments, and it can also achieve Selfie fill-in function
- Foldable visualiser for teaching: embedded design, occupies a small space after folding, easy to carry; Multi-joint support with multi-angle rotate freely usb camera can capture 2D and 3D objects better and shooting high-definition images and videos. Maximum covering area: 16.5" x 116" in (A3 paper)
- 8MP/2448P document camera for teachers with 30fps: using High-end image sensor, it output ultra-high-definition images and videos live transmission, up to 2448P megapixels. Press the focus button once to automatically focus the document camera once. Moving the object under the lens, the camera will not be arbitrary automatic focus and the image dance. Macro can capture objects as close as 3.94"
- Plug-n-Play & High Compatibility: the Kitchbai Visualiser comes with a USB-C cable that allows for instant plug-and-play operation for distance education and web conferencing. It applicable to Windows PCS (Windows 7/8/10/11) , Macs (OS10.11 or higher), and Chromebooks(38.00 or higher), and work with Tiktok, Google Meet, Skyp-Microsoft Teams, Zoom; it has built-in dual silicon microphones, which can reduce noise and improve sound quality
Or skip the browser setup
If you need screenshots of a finished gallery rather than an interactive gallery inside your site, ScreenshotNeo can capture the page with one request. It accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before the shot. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; response headers identify the page verdict and whether it was billed. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.
See the ScreenshotNeo documentation for all options, including full-page capture with lazy images loaded, CSS-selector element capture, device presets, custom CSS and JavaScript, waits, request blocking, cookies and headers, PDF output, caching, signed links, asynchronous jobs, bulk capture of up to 100 URLs per call and usage reporting.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/gallery -o gallery.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com/gallery"},
timeout=90,
)
r.raise_for_status()
open("gallery.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/gallery'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('gallery.webp', Buffer.from(await res.arrayBuffer()));
There is a free allowance of 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account to try it.
Frequently Asked Questions
Should every gallery use a carousel library?
No. A semantic list, CSS overflow and Scroll Snap cover the basic interaction. Add a library only when its extra state management or effects solve a requirement you cannot maintain clearly yourself.
How many images should one gallery contain?
There is no universal limit. Keep the set focused, optimize the files, and consider separate galleries or a lightbox when a long sequence becomes difficult to scan.
Can I use vertical slides?
Yes. Change the track to a vertical layout and use scroll-snap-type: y with scroll-snap-align; repeat the same labeling, keyboard and motion rules.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

