Knight Lab JuxtaposeJS
Before/after image slider for comparing photos. Embed in stories to show change over time.
What should journalists know about Knight Lab JuxtaposeJS?
JuxtaposeJS does exactly one thing: a draggable slider between two images. Paste two image URLs, add labels and credits, copy the embed code. Done. No account, no login, no data collection. Built by Northwestern's Knight Lab (same team behind TimelineJS and StoryMapJS). The library is 49.7% JavaScript, loads from Knight Lab's CDN, and works on any CMS. Touch/swipe support on mobile. Licensed under Mozilla Public License 2.0. The tool launched in 2014 and the last tagged release was v1.0.9 in December 2014 — but the library still works because the scope is so narrow that there's little to break. The GitHub repo has 873 stars and 46 open issues, many about responsive iframe sizing and mobile touch quirks. Development is effectively dormant. That's fine for what it does — but don't expect bug fixes or new features.
Before/after comparisons: natural disasters, construction progress, environmental change, conflict damage, urban development, satellite imagery over time. Any story where visual comparison tells it better than words. Works with photos and GIFs.
Comparing more than two images at once. Video comparisons. Complex data visualization. Stories needing custom slider styling or animation. If you need a self-hosted solution with active development, look at BeforeAfterly (browser-based, no uploads) or the open-source Improve-ImgSLI for desktop.
Security & Privacy
Data is scrambled while being sent to their servers
Data is scrambled when stored on their servers
Where servers are located — affects which governments can request your data
Privacy policy summary
JuxtaposeJS is client-side only. No images are uploaded to Knight Lab. No accounts, no cookies, no tracking from the library itself. The embed loads JavaScript from Knight Lab's CDN — standard CDN access logs may apply, but Knight Lab publishes no specific privacy policy for the CDN. Northwestern University's general privacy policy governs.
How to protect yourself:
Host images on your own servers or CMS rather than third-party services if the content is sensitive. The embed code loads JavaScript from cdn.knightlab.com — verify this is acceptable for your publishing platform's CSP headers. For full control, self-host the library from GitHub (MPL 2.0 license allows it). Be aware that the data-credit attribute renders raw HTML, which is a documented XSS vector if you accept untrusted input for credit fields.
Client-side tool with no data collection or server-side storage. Open source under MPL 2.0. Academic project with no commercial incentives. The XSS vector in credit fields is low-risk in practice (you control the input). Main concern is CDN dependency on cdn.knightlab.com — if Knight Lab infrastructure goes down or is compromised, embeds break. Self-hosting the library eliminates this risk.
Who Owns This
Known issues
Development is dormant — last tagged release was December 2014, 46 open GitHub issues. Responsive iframe sizing causes blank whitespace below the slider at different viewport widths; fix requires custom CSS media queries per embed. Touch interaction inside iframes is unreliable on some mobile browsers. The data-credit attribute renders raw HTML (documented XSS risk if credit fields accept untrusted input). Google Drive and Dropbox deprecated public file hosting, breaking older embeds that used those URLs. The showCredits option reportedly does nothing (#189). No ARIA labels or keyboard navigation — accessibility is poor. No support for web components (#188).
Pricing
Free. No paid tiers, no limits on embeds.
This is an editorial assessment based on publicly available information as of 2026-04-02, using our published methodology. Independent security review is pending. Security posture can change at any time. This is not a guarantee of safety.
Something wrong or outdated? Report it.