O'Reilly logo

HTML5: Your visual blueprint™ for designing rich web pages and applications by Adam McDaniel

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

USING SCROLLING TRANSITIONS WITH JQUERY

If your website uses any (<a href='#)topic'> Go To Topic</a> hash links tied to <h1 id= 'topic'>Topic Content</h1> markers on the same page, you can use jQuery and a plug-in called ScrollTo to provide a smooth-scrolling animation process.

Before you begin, your first option is to link directly to the jQuery ScrollTo plug-in from your web page, as described earlier in the chapter with the CDN method of jQuery itself, using http://flesler-plugins.googlecode.com/files/jquery.scrollTo-1.4.2.js.

Your second option is to download the plug-in file, place it on your web server, and load it directly:

<script src='jquery.scrollTo-1.4.2.js'></script>

After the file is imported, you can call the ScrollTo plug-in ...

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