O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing a tall page slowly as visitors watch

With what we've seen in the previous recipe, you should understand that the methodology behind scrolling an element is based on a two-element structure where one is the smaller, viewable area that masks the larger, content-containing element, and this larger, content element scrolls smoothly behind the viewable element.

How to do it...

Create a DIV with some content in it that can be scrolled. Use Moo-effects to create the scrolling process, then listen for user input to adjust the scrolling mechanism.

<script type="text/javascript" src="mootools-1.3.0.js"></script> <script type="text/javascript" src="mootools-more-1.3.0.js"></script> </head> <body> <div id="news"> Lorem ipsum dolor sit amet, ....<br/><br/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required