Dugg Nabbit made a decision. The change
$('html,body').animate({scrollTop: divTag.offset().top},'slow');
to
$('html').animate({scrollTop: divTag.offset().top},'slow');
if you want to avoid the Chrome obsolescence warning. ( Why is body.scrollTop deprecated? )
This works because documentElement is an html node:
$('html')[0] === document.documentElement //-> true $('body')[0] === document.body //-> true
But your code is working now (albeit with a warning), and it will continue to work when Chrome removes the "bizarre" behavior. You do not have to change the code if you want to continue supporting browsers that use body.scrollTop to present scrolling viewports in standard mode (I think older Chrome and Safari).
source share