Horizontal Pin Captions
Scrolling moves a row of large images sideways; inside each frame the photo drifts a little slower and the caption only appears once the image reaches the centre. For holiday homes, venues or collections.





Scroll om verder te kijken
How to use it
- Paste the HTML where the scroll effects should appear.
- Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
- Add the JavaScript and call init() with the element that contains the HTML.
<!-- Horizontal Pin Captions · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="nhp" tabindex="0" aria-label="Vakantiehuizen aan de kust, scroll om te bladeren">
<div class="nhp__lang">
<div class="nhp__pin">
<div class="nhp__baan">
<figure class="nhp__dia"><div class="nhp__raam"><img class="nhp__beeld" src="https://neddev.com/lab-media/hero-slideshow-1.webp" alt="Huisje tussen de duinen bij zonsondergang" loading="lazy"></div><figcaption class="nhp__tekst"><strong>Duinhuis Schoorl</strong><span>4 personen · vanaf € 165 per nacht</span></figcaption></figure>
<figure class="nhp__dia"><div class="nhp__raam"><img class="nhp__beeld" src="https://neddev.com/lab-media/hero-slideshow-2.webp" alt="Woonkamer met houtkachel en zicht op zee" loading="lazy"></div><figcaption class="nhp__tekst"><strong>Zeezicht Bergen aan Zee</strong><span>2 personen · vanaf € 140 per nacht</span></figcaption></figure>
<figure class="nhp__dia"><div class="nhp__raam"><img class="nhp__beeld" src="https://neddev.com/lab-media/hero-slideshow-4.webp" alt="Veranda met fietsen achter de duinen" loading="lazy"></div><figcaption class="nhp__tekst"><strong>Veranda Texel</strong><span>6 personen · vanaf € 210 per nacht</span></figcaption></figure>
<figure class="nhp__dia"><div class="nhp__raam"><img class="nhp__beeld" src="https://neddev.com/lab-media/ken-burns-hero-1.webp" alt="Polder met molen en koeien in de ochtend" loading="lazy"></div><figcaption class="nhp__tekst"><strong>Polderhoeve Kinderdijk</strong><span>8 personen · vanaf € 260 per nacht</span></figcaption></figure>
<figure class="nhp__dia"><div class="nhp__raam"><img class="nhp__beeld" src="https://neddev.com/lab-media/hero-slideshow-3.webp" alt="Strand met paalhoofden bij zonsondergang" loading="lazy"></div><figcaption class="nhp__tekst"><strong>Strandstudio Domburg</strong><span>2 personen · vanaf € 120 per nacht</span></figcaption></figure>
</div>
<p class="nhp__hint">Scroll om verder te kijken</p>
</div>
</div>
</div>
</div>/* Horizontal Pin Captions · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie */
.nhp{position:absolute;inset:0;overflow-y:auto;overflow-x:hidden;container-type:size;background:#f4f3f1;color:#0a0a0a;font-family:'Switzer',sans-serif;scrollbar-width:none;outline:none}
.nhp::-webkit-scrollbar{display:none}
.nhp:focus-visible{box-shadow:inset 0 0 0 2px #F5480F}
.nhp__lang{height:460cqh}
.nhp__pin{position:sticky;top:0;height:100cqh;overflow:hidden}
.nhp__baan{position:absolute;left:0;top:0;bottom:0;display:flex;align-items:center;gap:3cqw;padding:0 16cqw;will-change:transform}
.nhp__dia{flex:0 0 62cqw;height:72cqh;margin:0;display:flex;flex-direction:column}
.nhp__raam{position:relative;flex:1;min-height:0;overflow:hidden;border-radius:4px;background:#ddd8d0}
.nhp__beeld{position:absolute;top:0;left:-10%;width:120%;height:100%;object-fit:cover;display:block;will-change:transform}
.nhp__tekst{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 12px;padding-top:10px;font-size:clamp(12px,4.6cqh,17px);opacity:0;transform:translateY(12px)}
.nhp__tekst strong{font-weight:600}
.nhp__tekst span{color:#5b5750}
.nhp__hint{position:absolute;left:16cqw;bottom:3cqh;margin:0;font-size:13px;color:#5b5750;transition:opacity .3s}
.nhp__hint.is-weg{opacity:0}
@container (max-width:520px){.nhp__dia{flex-basis:76cqw;height:66cqh}.nhp__baan{padding:0 12cqw}.nhp__hint{left:12cqw}}// Horizontal Pin Captions · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie
// root = het element waarin de HTML staat
function init(root){
var s = root.querySelector('.nhp'); if (!s) return;
var baan = s.querySelector('.nhp__baan'), hint = s.querySelector('.nhp__hint');
var dias = Array.prototype.slice.call(s.querySelectorAll('.nhp__dia'));
var rustig = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
var afstand = 0, breed = 0, wacht = false;
function meet() {
breed = s.clientWidth;
var eerste = dias[0], laatste = dias[dias.length - 1];
var midEerste = eerste.offsetLeft + eerste.offsetWidth / 2, midLaatste = laatste.offsetLeft + laatste.offsetWidth / 2;
baan.dataset.start = (breed / 2 - midEerste);
afstand = midLaatste - midEerste;
teken();
}
function teken() {
wacht = false;
var max = s.scrollHeight - s.clientHeight;
var p = max > 0 ? Math.min(1, Math.max(0, s.scrollTop / max)) : 0;
var x = parseFloat(baan.dataset.start || 0) - p * afstand;
baan.style.transform = 'translate3d(' + x.toFixed(1) + 'px,0,0)';
dias.forEach(function (d) {
var mid = d.offsetLeft + d.offsetWidth / 2 + x;
var t = (mid - breed / 2) / breed;
var beeld = d.querySelector('.nhp__beeld'), tekst = d.querySelector('.nhp__tekst');
if (!rustig) beeld.style.transform = 'translate3d(' + (-t * 9).toFixed(2) + '%,0,0)';
var zicht = Math.max(0, 1 - Math.abs(t) * 3.2);
tekst.style.opacity = zicht.toFixed(3);
tekst.style.transform = rustig ? 'none' : 'translateY(' + ((1 - zicht) * 12).toFixed(1) + 'px)';
});
hint.classList.toggle('is-weg', p > 0.03);
}
s.addEventListener('scroll', function () { if (!wacht) { wacht = true; requestAnimationFrame(teken); } }, { passive: true });
if (window.ResizeObserver) new ResizeObserver(meet).observe(s); else window.addEventListener('resize', meet);
meet();
}
init(document.querySelector('.jouw-container'));
More scroll effects
Seen something you like?
Add it to your selection and send it over. We build your site around it, in your brand.
Get in touch →