Hi have navigation menu with two navigation arrows Prev and Next. This works fine in every browser (Firefox, IE, Opera, Safari) except in Chrome. It doesn’t even get a error message when the button is pressed.
Could someone please take a look on the code for the buttons. Am i missing something?
Thank you!
function scroll(direction) {
var scroll, i, positions = [], here = $(window).scrollTop(), collection = $('.box'), duration = 750, easing = "easeOutExpo";
collection.each(function() {
positions.push(parseInt($(this).offset()['top'], 10));
});
for( i = 0; i < positions.length; i++ ) {
if( direction == 'next' && positions[i] > here ) {
scroll = collection.get(i);
break;
}
if( direction == 'prev' && i > 0 && positions[i] >= here ) {
scroll = collection.get(i-1);
break;
}
}
if(scroll) {
$.scrollTo( scroll, { duration: duration, easing: easing });
}
return false;
}
$("a#prev, a#next").click(function() {
return scroll($(this).prop( 'id' ));
});
The issue was resolved when i downgraded the jQuery version from 1.8.2 to 1.6.2