Skip to content

Instantly share code, notes, and snippets.

@ambar
Created August 8, 2011 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambar/1131163 to your computer and use it in GitHub Desktop.
Save ambar/1131163 to your computer and use it in GitHub Desktop.
传送
var $anim = $(document[$.browser.webkit ? 'body' : 'documentElement']);
$btn.click(function() {
$anim.animate({scrollTop: 0});
return false;
});
@ambar
Copy link
Author

ambar commented Sep 8, 2011

// firefox # case ( document.doctype === null )
$(document.body).add(document.documentElement).animate({scrollTop: 0});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment