$(document).ready(function(){
var $scroller = $('html,body'),
$slides = $('.parallax-group').each(function(idx){
var target = $(this);
target.data('y', target.offset().top);
console.log(target.data('y'));
}),
$scrollPrev = $('.scroll-prev'),
$scrollNext = $('.scroll-next'),
slideName = '#group';
$scrollPrev.click(function(e){
e.preventDefault();
scrollIt(-1);
});
$scrollNext.click(function(e){
e.preventDefault();
if (!$scrollNext.data('disabled'))
scrollIt(1);
});
$('a[href^="#"]').on('click', function(event) {
if (this.hash.replace(/\d+$/, '') === slideName) {
var target = $(this.hash);
if( target.length > 0 ) {
event.preventDefault();
scrollTop(parseInt(this.hash), target.offset().top);
}
}
});
$('body').scrollspy({ target: '#navbar', offset: 30 });
function scrollTop(idx, y) {
$scroller.animate({scrollTop:y},1000, function(){
if (idx >= $slides.length){
$scrollNext.find('a').animate({opacity:.1}, 500);