• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Node ScrollIntoView (gallery-scrollintoview) on cdn

    Last Updated: 04/20/13
    + 1 -

    John Lindal

    YUI Contributor

    See 50 more by this user.

    Created: 12/8/09
    Last CDN Push: 04/24/13
    Build Tag: gallery-2013.04.24-22-00
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.5.1
    Free for use.

    This extension to Y.Node overrides scrollIntoView(). The default browser behavior always places the element at the top or bottom of its container. This override is smart enough to not scroll if the element is already visible, and it also provides animation.

    In addition, if the body does not have a scrollbar, this override will not scroll the body. The default browser behavior sometimes does, and then there is no way to recover.

    Yet another nice feature is the ability to specify a viewport margin, to keep the scrolled element from ending up under another element with position:fixed.

    • Tags:
    • plugin
    • scroll
    • node
    • jafl
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Example of scrolling a node into view.

    Code Sample

    <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2013.04.24-22-00'
    }).use('gallery-scrollintoview', function(Y)
    {
      Y.one('#my-button').scrollIntoView();
    });
     

    Forum Posts

    Subject Author Date
    ScrollIntoView doesn't work. John Mizliso 06/26/12
    Re: ScrollIntoView doesn't work. John Lindal 06/27/12
    Re: ScrollIntoView doesn't work. John Mizliso 06/27/12
    Only scrolls to nodes higher up the page richard g 09/25/12
    Re: Only scrolls to nodes higher up the page John Lindal 09/25/12
    Re: Only scrolls to nodes higher up the page richard g 09/26/12
    Smooth scrolling support richard g 01/15/13
    Re: Smooth scrolling support John Lindal 01/15/13
    Re: Smooth scrolling support John Lindal 04/24/13

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info