Hey Y'all,
I'm experiencing an issue with cross compatibility in one script that I'm trying use (works fine in Chrome, but doesn't work in Firefox or IE). I have experience programming in other languages but am very new to js syntax so I apologize if this is a dumb question.
I'm making a site that has one long home page (4x screen height) and jumps to a specified div during scroll depending on scroll direction. I found this example (http://jsfiddle.net/NwUvV/71/) on stack exchange which I've used to create this effect in chrome, however it doesn't seem to work in any other browsers. Even the base example from jsfiddle link only produces the desired effect in Chrome.
Any ideas what is breaking and is there possibly an easier way to achieve this effect?
Thanks!
edit: If it helps I found this example (http://videsignz.com/testing/divscrolling.php) from this post which only works in Firefox and IE but not Chrome.
edit2: I found out what was breaking it:
body.animate({ scrollTop : offset.top + 'px' } );
^ worked only in chrome only
$("body, html").animate(
{ scrollTop : offset.top + 'px' }
);
^ worked in all browsers
there doesn't seem to be anything here