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

Making anchors scroll smoothly into view rather than jump instantly

Many websites have had to make a list of internal anchors that cause the page to jump down to a particular section. The "jump" of the page is a bit of magic that many users do not recognize as an on-page link. Use this eye-candy effect to clearly show that the on-page link is scrolling the page.

Getting ready

Do not get up, do not get coffee, do not blink. The next recipe does days' worth of JavaScript work in one line! Get ready to smoothly scroll to an internal page link.

How to do it...

Brace yourself...

<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> Scrolling, Internal Navigation: ...

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