I have a navigation menu that is targeting anchors that are positioned by the data-position attribute within a page. I'm using this code snippet to make this work, and it works great in Safari and Chrome, but isn't working at all in Firefox. Is there a way to fix this? Thanks in advance for any assistance you can offer!
$(document).on('click','.navigation a', function(event){
event.preventDefault();
var $target = $( $(this).attr('href') );
var position = $target.data('position');
$('body').scrollTop( position * scrollHeight );
});