Sep 4, 2013

Animate scrollTop not working in Firefox

Firefox places the overflow at the html level, unless specifically styled to behave differently.

To get it to work in Firefox, use:

$('body,html').animate( ... );

Working example, SOURCE

The CSS solution would be to set the following styles:

html { overflow: hidden; height: 100%; }
body { overflow: auto; height: 100%; }

I would assume that the JS solution would be least invasive.

No comments: