Skip to content

Instantly share code, notes, and snippets.

@phorsfall
Created September 22, 2009 15:39
Show Gist options
  • Save phorsfall/191170 to your computer and use it in GitHub Desktop.
Save phorsfall/191170 to your computer and use it in GitHub Desktop.
// Prototype's scrollTo() for jQuery.
//
// Usage:
// $('#element').scrollTo();
//
$.fn.scrollTo = function() {
var offset = this.offset();
window.scrollTo(offset['left'], offset['top']);
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment