vedi prego questo:Come far scattare il plugin per waypoint jQuery quando un elemento è in vista e non scorre oltre?
Come si può vedere solo quando si scorre oltre il primo rettangolo rosso diventa blu, vorrei che diventi blu nel momento in cui entra in vista. Questo è il motivo per cui il secondo non diventa mai blu perché non c'è abbastanza contenuto al di sotto di esso per consentire di scorrere oltre.
HTML:
Scoll this window pane
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="box"></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="box"></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
CSS:
.box { width: 250px; height: 100px; border: 2px solid red; }
jQuery:
$.getScript('http://imakewebthings.com/jquery-waypoints/waypoints.min.js', function() {
$('.box').waypoint(function() {
$(this).css({
borderColor: 'blue'
});
});
});
Come per renderlo fuoco il più presto l'elemento in questione si vede e non scorrere passato?
molto bello, grazie! – TK123
@imakewebthings Scusa non sapevo come contattarti su StackOverflow ma sono preoccupato di qualcosa relativo ai Waypoint puoi per favore dare un'occhiata? ** [CLICCA QUI] (http://stackoverflow.com/questions/23563016/waypoint-not-working-on-overflowhidden) ** –
I cosa puoi sapere più chiaramente sul waypoint se leggi questo articolo. http://www.script-tutorials.com/scrollbar-jquery-event-handling-using-waypoints/ @ tk123 – Bipon