jQuery plugin to smoothly scroll elements into view.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2fbb80b Aug 30, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.rdoc Updated date of last update Jan 8, 2013
bower.json Added bower.json Aug 30, 2015
jquery.scrollIntoView.js Fixed syntax issue from last pull request Mar 10, 2013
jquery.scrollIntoView.min.js Updated with fixed pull request #7 Mar 10, 2013




Arwid Bancewicz arwid.ca




8 Jan 2013

Similar to the default browser scrollIntoView, this jQuery plugin scrolls an element into view to the top or bottom of its container but not if it's already visible. The demo page is here arwid.github.com/jQuery.scrollIntoView/.


An animated scroll:


No animation:


Configure the animation (same options as in jQuery animate()):

$("#some_element").scrollIntoView(250, "easeOutExpo", function() { alert("done scroll!") });

  duration: true,
  complete: $.noop(),
  step: $.noop(),
  queue: false,
  specialEasing: null

Same for multiple elements:

  • Refer to api.jquery.com/animate/ for a description of the options.

  • By default the animation easing will be 'easeOutExpo' if jQuery UI Effects is included before this file. Otherwise, it'll use jQuery's default 'swing' easing which isn't great. So make sure to download Effects Core from jqueryui.com/download and include it before this file for a better animation.

Also Included

Also included is a utility method isOutOfView that works for multiple elements:


Or for completely out of view:


Also included is a utility called commonAncestor which returns the common ancestor of elements:



jQuery.scrollIntoView is covered by the MIT License.