<div class="wrap">
<div class="layer">
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
<div class="post"></div>
</div>
</div>
<span class="next" style="cursor:pointer;"> (next div) </span>
jQuery with ScrollTo Plugin (http://demos.flesler.com/jquery/scrollTo/)
$('.next').click(function() {
$(".wrap").scrollTo( $('.post').next(), 800, {margin:true} );
});
Demo : http://jsfiddle.net/UaGjs/8/
It doesnt work :( It work only 1st time
Working on Tomalak's answer you need to update the reference obj points to to the next element
var next;
$('.next').click(function() {
if ( next === undefined ) {
next = $('.post').next();
} else {
next = next.next();
}
$(".wrap").scrollTo(next , 800, {margin:true} );
});
I've updated it with Prev but it can be improved to remove the duplication
I've noticed there is an occompanying plugin called Serial Scroll
Final edit