Hi wolf,

I ran into the same problem, but on John Resig's recommendation I add "html" to the selector and it worked:

$( 'html, body' ).animate( { scrollTop: y }, d, 'bounceout' ); };

See my blog entry for more information:

http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Sep 20, 2007, at 9:12 AM, wolf wrote:




i am looking for a solution to scroll pages smoothly and found the
example at

http://dev.jquery.com/~john/ticket/step/test2.html

that does exactly what i want. i ported the code, but to my dismay, it
stopped working in both firefox and ie. i finally found the culprit
is, surprise!, the XHTML doctype declaration i put at the very top of
my version:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

i can remove the declaration and the script works again. i also tried
to build a scrolling animation method on my own, and it does seem to
work, but i would very much prefer the standard solution.

any ideas why an XHTML document refuses to do

$( 'body' ).animate( { scrollTop: y }, d, 'bounceout' ); };

while an HTML document (and even a non-valid HTML-fragment like the ../
test2.html page) has no such problems?

thanks in advance for any comments.

_wolf


Reply via email to